Skip to main content

Manager for test data providing downloads, caching of generated files, and a context for temp directories.

Project description

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.

The datadir_mgr fixture provides four methods of interest:

  • 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).

Prerequisites

Python 3.6 or greater is required. This package is tested under Linux and MacOS using Python 3.7.

Installation for Users

Install via pip

pip install pytest-datadir-mgr

For Developers

If you plan to develop bionorm, you’ll need to install the poetry dependency manager. If you haven’t previously installed poetry, execute the command:

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

Next, get the master branch from GitHub

git clone https://github.com/ncgr/pytest-datadir-mgr.git

Change to the datadir-mgr/ directory and install with poetry:

poetry install -v

Test datadir-mgr with poetry:

poetry run pytest -s

Project Status

Latest Release

Python package

GitHub

GitHub repository

License

License terms

Travis Build

Travis CI

Coverage

Codecov.io test coverage

Code Grade

Codacy.io grade

Dependencies

dependabot dependencies

Issues

Issues reported

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-datadir-mgr-0.1.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

pytest_datadir_mgr-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest-datadir-mgr-0.1.0.tar.gz.

File metadata

  • Download URL: pytest-datadir-mgr-0.1.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/5.6.0-gentoo-x86_64

File hashes

Hashes for pytest-datadir-mgr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 08112cfabfc226e09f71160ef94d4ae6d3744dc2dea16ee2b0ce9041e2267b72
MD5 60b8d12a2a59dba03f20abd81984c54f
BLAKE2b-256 49aab81ae2797d8a0e4fc42578c6f859eefff7718e5b0748437277755dcee386

See more details on using hashes here.

File details

Details for the file pytest_datadir_mgr-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_datadir_mgr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/5.6.0-gentoo-x86_64

File hashes

Hashes for pytest_datadir_mgr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d9f0ff4b19dd62028c39f18b9d743ee5c9ed0443aa614e427bdaea4da1dfc23
MD5 16a08f8280bc7ce8244019045ec27fe6
BLAKE2b-256 f71f84873d86a63f6208d7a9ce8ee3f9495925ccbc1880f29d41fb91ae51b78d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page