skillfed

pytest-localftpserver

A PyTest plugin which provides an FTP fixture for your tests

pytest-localftpserver v1.6.0 74.9K downloads/30d#14,781 on PyPI18
Permissive license Active released

What it is and what it does

pytest-localftpserver is a pytest plugin that injects ftpserver and ftpserver_TLS fixtures into your test suite, each providing a threaded, in-process FTP server instance. This lets you write tests that exercise FTP client code—uploads, downloads, authentication, directory operations—without needing an external FTP server or network access. The plugin depends on pyftpdlib for the server implementation and PyOpenSSL for TLS support.

You configure the server's behavior (username, password, port, home directory, certificate path) via environment variables or pytest configuration files. The fixture scope can be set per-function, per-module, or per-session, making it flexible for different test strategies. Since the server runs in a thread within your test process, it starts and stops with each test or test session, keeping your test environment isolated and reproducible.

Use it for:

  • Test FTP client libraries or custom upload/download code without a live FTP server.
  • Verify authentication and permission handling in FTP-based workflows.
  • Test TLS/SSL FTP connections with a local certificate in CI/CD pipelines.
  • Validate error handling when FTP operations fail (connection refused, auth denied).
  • Integration test file transfer workflows in isolation from external services.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides pytest fixtures for running local FTP and TLS-FTP servers in tests, enabling you to test FTP client functionality without external dependencies.

Yes. This is a stable, actively maintained pytest plugin (released 3 days ago, in production since 2016) with no known vulnerabilities, low install friction, and a clear use case: testing FTP client code locally. The MIT license is permissive. Install it if you need to test FTP functionality in your test suite.

Install

pytest-localftpserver on PyPI

pip

pip install pytest-localftpserver

uv

uv add pytest-localftpserver

poetry

poetry add pytest-localftpserver

Installing pytest-localftpserver

Before you install

Low friction install with stable maintenance: released 3 days ago, active repository, and depends only on pyftpdlib, PyOpenSSL, and pytest—all widely used packages.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.

Quickstart

# Install
pip install pytest-localftpserver

# In your test file
import pytest

def test_ftp_upload(ftpserver):
    # ftpserver fixture provides a running FTP server
    # Configure via environment variables: FTP_USER, FTP_PASS, FTP_PORT, FTP_HOME
    pass

Requires pytest to be installed; FTP server configuration is set via environment variables (FTP_USER, FTP_PASS, FTP_PORT, FTP_HOME) or pytest.ini/tox.ini.

Verify before relying

  • Whether the ftpserver_TLS fixture works reliably with modern TLS versions and certificate formats.
  • Performance characteristics when running many concurrent FTP connections in tests.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 3 — pyftpdlib, PyOpenSSL, pytest
Maintenance actively maintained — 3 days since the last release
Last repo commit
First released
Downloads 74,863/month — #14,781 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pytest_localftpserver-1.6.0-py3-none-any.whl

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: TestingTopic :: Software Development :: Testing :: Mocking

Tags

pytest ftp server fixtureftp testing pluginlocal ftp server testsftp mock testingpytest ftp fixturetest ftp client codeftp integration testing
ftp-testingpytest-plugintest-fixtures

More Testing packages