Install & Compatibility
Where this runs
tested against v0.5.13 · 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
muslpy 3.10–3.925 runs
installs and imports cleanly · install 0.0s · import 0.410s · 72.8MB
glibcpy 3.10–3.925 runs
installs and imports cleanly · install 12.3s · import 0.374s · 75MB
76MB installed
● package 76MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
s3_server
✓ from pytest_servers.s3 import s3_server
✗ from pytest_servers import s3_server
s3_server is in a submodule, not top-level.
gcs_server
✓ from pytest_servers.gcs import gcs_server
No common wrong import found.
azurite_server
✓ from pytest_servers.azure import azurite_server
sftp_server
✓ from pytest_servers.sftp import sftp_server
Use fixtures to start local mock servers for testing cloud storage integrations.
import pytest
from pytest_servers.s3 import s3_server
from pytest_servers.gcs import gcs_server
from pytest_servers.azure import azurite_server
from pytest_servers.sftp import sftp_server
@pytest.mark.usefixtures('s3_server')
def test_s3():
# s3_server fixture starts a mock S3 server (using minio) in a Docker container
# The endpoint is available via os.environ['AWS_ENDPOINT_URL']
import os
assert 'AWS_ENDPOINT_URL' in os.environ
print(f"S3 endpoint: {os.environ['AWS_ENDPOINT_URL']}")
@pytest.mark.usefixtures('gcs_server')
def test_gcs():
import os
assert 'STORAGE_EMULATOR_HOST' in os.environ
print(f"GCS endpoint: {os.environ['STORAGE_EMULATOR_HOST']}")
@pytest.mark.usefixtures('azurite_server')
def test_azure():
import os
assert 'AZURITE_HOST' in os.environ
print(f"Azure endpoint: {os.environ['AZURITE_HOST']}")
@pytest.mark.usefixtures('sftp_server')
def test_sftp():
import os
assert 'SFTP_HOST' in os.environ
print(f"SFTP endpoint: {os.environ['SFTP_HOST']}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pytest_servers'
pytest-servers is not installed or the import path is wrong.
fixInstall with `pip install pytest-servers` and use correct import: `from pytest_servers.s3 import s3_server`.
docker.errors.DockerException: Error while fetching server API version: ...
Docker daemon is not running or the user does not have permissions.
fixStart Docker and ensure your user has access (e.g., add to docker group).
pytest fixture 's3_server' not found
The fixture is not registered; likely missing the plugin or import.
fixInstall pytest-servers and either use `pytest_plugins = ['pytest_servers.s3']` in conftest or import the fixture directly.
Upgrade
Version history
0.5.13latest on PyPI · released Dec 21, 2025
Audit
Dependencies
dockerrequiredRequired to run containerized servers.
boto3optionalRequired for S3 server fixture.
google-cloud-storageoptionalRequired for GCS server fixture.
azure-storage-bloboptionalRequired for Azure Blob server fixture.
paramikooptionalRequired for SFTP server fixture.
pytestrequiredPlugin requires pytest to run.