{"id":28794471,"url":"https://github.com/iterative/pytest-servers","last_synced_at":"2025-10-26T13:06:44.845Z","repository":{"id":37838195,"uuid":"438634247","full_name":"iterative/pytest-servers","owner":"iterative","description":"Create temporary directories on the various filesystems for testing","archived":false,"fork":false,"pushed_at":"2025-10-20T20:33:07.000Z","size":247,"stargazers_count":18,"open_issues_count":12,"forks_count":5,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-10-20T22:28:28.358Z","etag":null,"topics":["dvc","python","storage","test","testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iterative.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.rst","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-15T13:10:36.000Z","updated_at":"2025-08-04T18:53:42.000Z","dependencies_parsed_at":"2024-04-26T10:44:21.142Z","dependency_job_id":"bfa23560-2c8b-43eb-8ee0-f3e145751a09","html_url":"https://github.com/iterative/pytest-servers","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/iterative/pytest-servers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2Fpytest-servers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2Fpytest-servers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2Fpytest-servers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2Fpytest-servers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iterative","download_url":"https://codeload.github.com/iterative/pytest-servers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2Fpytest-servers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281107435,"owners_count":26444861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dvc","python","storage","test","testing"],"created_at":"2025-06-18T02:38:27.376Z","updated_at":"2025-10-26T13:06:44.838Z","avatar_url":"https://github.com/iterative.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pytest servers\n--------------\n\n|PyPI| |Status| |Python Version| |License|\n\n|Tests| |Codecov| |pre-commit| |Black|\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/pytest-servers.svg\n   :target: https://pypi.org/project/pytest-servers/\n   :alt: PyPI\n.. |Status| image:: https://img.shields.io/pypi/status/pytest-servers.svg\n   :target: https://pypi.org/project/pytest-servers/\n   :alt: Status\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/pytest-servers\n   :target: https://pypi.org/project/pytest-servers\n   :alt: Python Version\n.. |License| image:: https://img.shields.io/pypi/l/pytest-servers\n   :target: https://opensource.org/licenses/Apache-2.0\n   :alt: License\n.. |Tests| image:: https://github.com/iterative/pytest-servers/workflows/Tests/badge.svg\n   :target: https://github.com/iterative/pytest-servers/actions?workflow=Tests\n   :alt: Tests\n.. |Codecov| image:: https://codecov.io/gh/iterative/pytest-servers/branch/main/graph/badge.svg\n   :target: https://app.codecov.io/gh/iterative/pytest-servers\n   :alt: Codecov\n.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white\n   :target: https://github.com/pre-commit/pre-commit\n   :alt: pre-commit\n.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n   :alt: Black\n\n\nFeatures\n--------\n\nCreate temporary directories on the following filesystems:\n\n- Local fs\n- In-memory fs\n- S3, both using mock S3 remotes (https://github.com/spulec/moto) and real S3 remotes\n- Azure, both using mock Azure remotes (https://github.com/Azure/Azurite) via docker and using real Azure Storage remotes\n- Google Cloud Storage, both using mock GCS remote (https://github.com/fsouza/fake-gcs-server) via docker and using real Google Storage Remotes\n\nInstallation\n------------\n\nYou can install *pytest servers* via pip_ from PyPI_:\n\n.. code:: console\n\n   $ pip install pytest-servers\n\nTo use temporary S3 paths:\n\n.. code:: console\n\n   $ pip install pytest-servers[s3]\n\nTo use temporary Azure paths\n\n.. code:: console\n\n   $ pip install pytest-servers[azure]\n\nTo use temporary Google Cloud Storage paths\n\n.. code:: console\n\n    $ pip install pytest-servers[gcs]\n\nTo install all extras:\n\n.. code:: console\n\n   $ pip install pytest-servers[all]\n\nUsage\n------------\n\nThe main fixture provided by `pytest-servers` provides is `tmp_upath_factory`, which can be used\nto generate temporary paths on different (mocked) filesystems:\n\n.. code:: python\n\n   def test_something_on_s3(tmp_upath_factory):\n       path = tmp_upath_factory.mktemp(\"s3\")\n       foo = path / \"foo\"\n       foo.write_text(\"foo\")\n       ...\n\n`mktemp` supports the following filesystem types:\n\n- ``local`` (local filesystem)\n- ``memory`` (in-memory filesystem)\n- ``s3`` (Amazon S3)\n- ``gcs`` (Google Cloud Storage)\n- ``azure`` (Azure Storage)\n\nSome convenience fixtures that wrap `tmp_upath_factory.mktemp` and return a paths on these filesystems are also available:\n\n- ``tmp_local_path``\n- ``tmp_memory_path``\n- ``tmp_s3_path``\n- ``tmp_gcs_path``\n- ``tmp_azure_path``\n\nThe `tmp_upath` fixture can be used for parametrizing paths with pytest's indirect parametrization:\n\n.. code:: python\n\n   @pytest.mark.parametrize(\"tmp_upath\", [\"local\", \"s3\", \"gcs\", \"gs\"], indirect=True)\n   def test_something(tmp_upath):\n       pass\n\nIn order to use real remotes instead of mocked ones, use `tmp_upath_factory` with the following methods\n\n- ``tmp_upath_factory.s3(region_name, client_kwargs)`` where client_kwargs are passed to the underlying S3FileSystem/boto client\n- ``tmp_upath_factory.gcs(endpoint_url)``\n- ``tmp_upath_factory.azure(connection_string)``\n\n\nVersioning support can be used by using the `versioning` fixture. This is currently supported for s3 and gcs remotes\n\n.. code:: python\n\n   # using mktemp\n   def test_something_on_s3_versioned(tmp_upath_factory):\n       path = tmp_upath_factory.mktemp(\"s3\", version_aware=True)\n       assert path.fs.version_aware # bucket has versioning enabled\n\n   # or, using remote-specific fixtures\n   def test_something_on_s3_versioned(tmp_s3_path, versioning):\n       assert tmp_s3_path.fs.version_aware # bucket has versioning enabled\n\n\nContributing\n------------\n\nContributions are very welcome.\nTo learn more, see the `Contributor Guide`_.\n\nLicense\n--------------\nDistributed under the terms of the `Apache 2.0 license`_,\n*pytest servers* is free and open source software.\n\nIssues\n-------------\n\nIf you encounter any problems,\nplease `file an issue`_ along with a detailed description.\n\n\n.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0\n.. _PyPI: https://pypi.org/\n.. _file an issue: https://github.com/iterative/pytest-servers/issues\n.. _pip: https://pip.pypa.io/\n.. github-only\n.. _Contributor Guide: CONTRIBUTING.rst\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiterative%2Fpytest-servers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiterative%2Fpytest-servers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiterative%2Fpytest-servers/lists"}