Registry / testing / pytest-localftpserver

pytest-localftpserver

JSON →
library1.5.0pypypiunverified

A PyTest plugin that provides an FTP fixture (localftpserver) for your tests, enabling you to spin up a real FTP server during testing. Version 1.5.0 is the latest release; the project is in maintenance mode with infrequent updates.

pip install pytest-localftpserver
INSTALL
IMPORT
SIG · PYTEST-LOCALFTPSER
P
pytest-localftpserver
testingpythonv1.5.0
Install
5.4s avg
Import
—
Disk
47MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 48.2MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 5.4s · import 0.000s · 49MB
47MB installed
● package 47MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

localftpserver
✓ no import needed; use fixture name in test function argument
The fixture is automatically registered by the plugin; just add 'localftpserver' as a parameter to your test function.

A minimal test using the localftpserver fixture. The fixture starts an FTP server on a random port; the session() context manager gives you a connected FTP client.

def test_ftp(localftpserver): with localftpserver.session() as ftp: ftp.login('user', 'pass') ftp.cwd('/') assert ftp.pwd() == '/' ftp.storbinary('STOR testfile', b'data') ftp.retrbinary('RETR testfile', lambda x: None)
Debug
Known issues
gotchaThe fixture starts a real FTP server on a random port; ensure you don't have conflicting services or firewall restrictions.
fix
Use the default configuration or set the port via pytest options.
affects: all
deprecatedThe project has not been updated in years and may have compatibility issues with newer Python versions or pytest 7+.
fix
Consider using alternative solutions like pyftpdlib directly or pytest-docker for FTP testing.
affects: >=1.5.0
gotchaThe fixture does not clean up the server after each test by default; ensure you close sessions properly to avoid hanging processes.
fix
Always use the session() context manager or manually close the FTP client.
affects: all
Upgrade
Version history
1.5.0latest on PyPI · released Nov 16, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
Resources
pytest-localftpserver — pip install pytest-localftpserver · libregistry