{"id":13542150,"url":"https://github.com/gabrielcnr/pytest-datadir","last_synced_at":"2025-05-14T20:07:52.193Z","repository":{"id":34516487,"uuid":"38458365","full_name":"gabrielcnr/pytest-datadir","owner":"gabrielcnr","description":"pytest plugin for manipulating test data directories and files","archived":false,"fork":false,"pushed_at":"2025-03-31T18:17:42.000Z","size":124,"stargazers_count":255,"open_issues_count":3,"forks_count":24,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T12:05:40.872Z","etag":null,"topics":["plugin","pytest","python","tdd","testdata","testing"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielcnr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-02T21:41:44.000Z","updated_at":"2025-03-31T18:17:46.000Z","dependencies_parsed_at":"2023-02-19T13:40:17.463Z","dependency_job_id":"e295c5bd-3a97-4fbe-b3c6-cc752aba66f1","html_url":"https://github.com/gabrielcnr/pytest-datadir","commit_stats":{"total_commits":110,"total_committers":14,"mean_commits":7.857142857142857,"dds":0.7181818181818183,"last_synced_commit":"ecc13cab0926ffd6f6282485b2832c11df73a7a4"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcnr%2Fpytest-datadir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcnr%2Fpytest-datadir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcnr%2Fpytest-datadir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcnr%2Fpytest-datadir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielcnr","download_url":"https://codeload.github.com/gabrielcnr/pytest-datadir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732486,"owners_count":21152852,"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","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":["plugin","pytest","python","tdd","testdata","testing"],"created_at":"2024-08-01T10:01:02.046Z","updated_at":"2025-04-13T15:10:24.612Z","avatar_url":"https://github.com/gabrielcnr.png","language":"Python","funding_links":[],"categories":["Python","Testing Tools","Plugins"],"sub_categories":[],"readme":"# pytest-datadir\n\npytest plugin for manipulating test data directories and files.\n\n[![Build Status](https://github.com/gabrielcnr/pytest-datadir/workflows/build/badge.svg?branch=master)](https://github.com/gabrielcnr/pytest-datadir/workflows/build/badge.svg?branch=master)\n[![PyPI](https://img.shields.io/pypi/v/pytest-datadir.svg)](https://pypi.python.org/pypi/pytest-datadir)\n[![CondaForge](https://img.shields.io/conda/vn/conda-forge/pytest-datadir.svg)](https://anaconda.org/conda-forge/pytest-datadir)\n![Python Version](https://img.shields.io/badge/python-3.6+-blue.svg)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n\n# Usage\npytest-datadir will look up for a directory with the name of your module or the global 'data' folder.\nLet's say you have a structure like this:\n\n```\n.\n├── data/\n│   └── hello.txt\n├── test_hello/\n│   └── spam.txt\n└── test_hello.py\n```\nYou can access the contents of these files using injected variables `datadir` (for *test_* folder) or `shared_datadir`\n(for *data* folder):\n\n```python\ndef test_read_global(shared_datadir):\n    contents = (shared_datadir / \"hello.txt\").read_text()\n    assert contents == \"Hello World!\\n\"\n\n\ndef test_read_module(datadir):\n    contents = (datadir / \"spam.txt\").read_text()\n    assert contents == \"eggs\\n\"\n```\n\npytest-datadir will copy the original file to a temporary folder, so changing the file contents won't change the original data file.\n\nBoth `datadir` and `shared_datadir` fixtures are `pathlib.Path` objects.\n\n# License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcnr%2Fpytest-datadir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielcnr%2Fpytest-datadir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcnr%2Fpytest-datadir/lists"}