--- id: pytest-sftpserver version: "1.3.0" license: MIT License license_treatment: permissive maintenance: dormant --- # pytest-sftpserver — py.test plugin to locally test sftp server connections. License: permissive · Maintenance: dormant · Downloads: 1.1M/mo ## What it is and what it does pytest-sftpserver is a pytest plugin that injects an SFTP server fixture into your tests. Rather than serving files from disk, it serves content directly from Python objects—dictionaries representing directory structures and file contents. This lets you test SFTP client code (code that connects to and downloads from SFTP servers) without spinning up a real external server or managing temporary files. The plugin depends on paramiko for SFTP protocol handling and six for Python 2/3 compatibility. It's designed for unit and integration testing of SFTP client functions. The package has been dormant since 2019 but remains functional; it targets Python 2.7 and 3.5–3.7 according to its classifiers. Use it for: - Unit test an SFTP client function by mocking server responses with in-memory file structures instead of real files. - Integration test a data pipeline that fetches files from SFTP without requiring a live SFTP server in CI/CD. - Test error handling in SFTP client code by simulating missing files or permission issues via the mock server. - Verify SFTP connection logic and authentication flows in isolation without external infrastructure. - Test directory traversal and recursive file operations against a controlled mock SFTP environment. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that provides a fixture for testing SFTP client code against an in-memory mock SFTP server without needing an external server. Yes, if you need to test SFTP client code and want to avoid external server setup. The low install friction, permissive license, and zero known vulnerabilities make it a straightforward choice. However, note that the package is dormant (last release 2019) and classifiers indicate support only through Python 3.7—verify compatibility with your target Python version before adopting. ## Install pip install pytest-sftpserver uv add pytest-sftpserver poetry add pytest-sftpserver ## Installing pytest-sftpserver Before you install: Low install friction with only two runtime dependencies (paramiko and six). The package is dormant—last release was 2019-09-16 and last commit 2024-03-20—so maintenance is minimal but the codebase remains archived and functional. License in practice: MIT License (permissive) means you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions. Quickstart: pip install pytest-sftpserver import pytest from pytest_sftpserver import sftpserver def test_sftp_fetch(sftpserver): with sftpserver.serve_content({'a_dir': {'somefile.txt': 'File content'}}): # Test your SFTP client code here pass Verify before relying: - Whether the package works with Python versions beyond 3.7 (classifiers list only 2.7, 3.5–3.7, but last commit is 2024) - Whether paramiko and six versions have known compatibility issues with modern Python environments ## Package facts - License: MIT License (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest sftp server fixture, mock sftp testing, local sftp server testing, sftp client unit tests, pytest sftp mock, in-memory sftp server, test sftp connections locally, pytest-plugin, sftp-testing, mock-server [View on SkillFed](https://skillfed.io/packages/pytest-sftpserver) · [View on PyPI](https://pypi.org/project/pytest-sftpserver/)