Skip to main content
Python package Supported Python Versions GitHub repository Download stats PYPI download rate
License terms GitHub Actions Codecov.io test coverage Codacy.io grade Issues reported
Logo credit Jørgen Stamp, published under a Creative Commons Attribution 2.5 Denmark License.

The datadir-mgr plugin for pytest provides the datadir_mgr fixture which allow test functions to easily download data files and cache generated data files in data directories in a manner that allows for overlaying of results. datadir-mgr is pathlib-based, so complete paths to data files are handled, not just filenames.

This plugin behaves like a limited dictionary, with datadir_mgr[item] returning a path with the most specific scope (out of global, module, [class], [function] that matches the string or path specified by item. In addition to serving data files already stored in the data directory, the fixture provides five methods useful for adding to the test data stored in the repository:

  • The download method allows downloading data files into data directories, with option MD5 checksum checks, un-gzipping, and a progressbar.

  • The savepath fixture lets an arbitrary path relative to the current working directory to be saved at a particular scope in the data directories.

  • The add_scope method lets one add directories from scopes different from the present request to be added to the search path. This lets the results of previous cached steps to be used in scopes other than global.

  • The in_tmp_dir method creates a context in a temporary directory with a list of request file paths copied in. Optionally, all output file paths can be saved at a particular scope at cleanup with an optional exclusion filter pattern (e.g., for excluding log files). Note that files in directories that begin with test_ or end with _test could be confused with scope directories and cannnot be saved. If progressbar is set to “True”, then the progress of file copying will be shown, which is helpful in some long-running pytest jobs, e.g. on Travis.

  • The paths_from_scope returns a list of all paths to files from a specified scope.

Prerequisites

Python 3.6 or greater is required. This package is tested under Linux, MacOS, and Windows using Python 3.9.

Release files for pytest-datadir-mgr 1.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-datadir-mgr 1.3.4
File Size Uploaded
pytest_datadir_mgr-1.3.4.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-datadir-mgr 1.3.4
File Interpreter ABI Platform
pytest_datadir_mgr-1.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / pytest_datadir_mgr-1.3.4.tar.gz

Download URL pytest_datadir_mgr-1.3.4.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bb0197c721d94bc7011b3eea79415d8b7c749d80a94029129d28974c22f4f9c5
BLAKE2b-256 checksum
How to use checksums
71aeee16254bc40c38b2d15f833f1f337d3bb0222a64c37743caa4b6a4843d52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.11.3 Linux/6.2.9-gentoo-dist

Release files / pytest_datadir_mgr-1.3.4-py3-none-any.whl

Download URL pytest_datadir_mgr-1.3.4-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a7fc9cb43959c4c2dfcde24fdb7e6bc5398f7947de3725a5e4add07b07cabd7
BLAKE2b-256 checksum
How to use checksums
6e084154a1b78f6933e1bef46543af48a0a021147b9702735295b66946467899
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.11.3 Linux/6.2.9-gentoo-dist

Release history Release notifications | RSS feed

This release

1.3.4 This release

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.2.7

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.1

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page