pytest-localftpserver
A PyTest plugin which provides an FTP fixture for your tests
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-localftpserveruv
uv add pytest-localftpserverpoetry
poetry add pytest-localftpserverInstalling 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
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-sftpserverA pytest plugin that provides a fixture for…
permissive · top 5,000 on PyPI
pytest-regressionsProvides pytest fixtures for writing regression…
permissive · top 5,000 on PyPI
pytest-rabbitmqA pytest plugin that provides fixtures to start…
copyleft · top 15,000 on PyPI
pytest-redisA pytest plugin that provides fixtures for…
copyleft · top 15,000 on PyPI
pytest-httpbinProvides a pytest fixture that runs a local…
permissive · top 15,000 on PyPI
pytest-mockProvides a pytest fixture that wraps the mock…
permissive · top 1,000 on PyPI
pytest-postgresqlA pytest plugin that provides fixtures to…
copyleft · top 5,000 on PyPI
pytest-mysqlA pytest plugin that provides MySQL and MariaDB…
copyleft · top 15,000 on PyPI
pytest-dockerpytest-docker provides pytest fixtures that…
permissive · top 5,000 on PyPI
pyftpdlibBuilds asynchronous FTP servers in Python with…
unclear · top 15,000 on PyPI