pytest-datadir-mgr


Namepytest-datadir-mgr JSON
Version 1.3.3 PyPI version JSON
download
home_pagehttps://github.com/joelb123/pytest-datadir-mgr
SummaryManager for test data: downloads, artifact caching, and a tmpdir context.
upload_time2023-04-06 19:37:14
maintainer
docs_urlNone
authorJoel Berendzen
requires_python>=3.8,<4.0
licenseBSD-3-Clause
keywords testing pytest-plugins downloads data manager test data software engineering
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            =============================
datadir-mgr plugin for pytest
=============================
.. badges-begin

| |pypi| |Python Version| |repo| |downloads| |dlrate|
| |license|  |build| |coverage| |codacy| |issues|

.. |pypi| image:: https://img.shields.io/pypi/v/pytest-datadir-mgr.svg
    :target: https://pypi.python.org/pypi/pytest-datadir-mgr
    :alt: Python package

.. |Python Version| image:: https://img.shields.io/pypi/pyversions/pytest-datadir-mgr
   :target: https://pypi.python.org/pypi/pytest-datadir-mgr
   :alt: Supported Python Versions

.. |repo| image:: https://img.shields.io/github/last-commit/joelb123/pytest-datadir-mgr
    :target: https://github.com/joelb123/pytest-datadir-mgr
    :alt: GitHub repository

.. |downloads| image:: https://pepy.tech/badge/pytest-datadir-mgr
     :target: https://pepy.tech/project/pytest_datadir_mgr
     :alt: Download stats

.. |dlrate| image:: https://img.shields.io/pypi/dm/pytest-datadir-mgr
   :target: https://github.com/joelb123/pytest-datadir-mgr
   :alt: PYPI download rate

.. |license| image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
    :target: https://github.com/joelb123/pytest-datadir-mgr/blob/master/LICENSE.txt
    :alt: License terms

.. |build| image:: https://github.com/joelb123/pytest-datadir-mgr/workflows/tests/badge.svg
    :target:  https://github.com/joelb123/pytest-datadir-mgr.actions
    :alt: GitHub Actions

.. |codacy| image:: https://api.codacy.com/project/badge/Grade/f306c40d604f4e62b8731ada896d8eb2
    :target: https://www.codacy.com/gh/joelb123/pytest-datadir-mgr?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=joelb123/pytest-datadir-mgr&amp;utm_campaign=Badge_Grade
    :alt: Codacy.io grade

.. |coverage| image:: https://codecov.io/gh/joelb123/pytest-datadir-mgr/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/joelb123/pytest-datadir-mgr
    :alt: Codecov.io test coverage

.. |issues| image:: https://img.shields.io/github/issues/joelb123/pytest-datadir-mgr.svg
    :target:  https://github.com/joelb123/pytest-datadir-mgr/issues
    :alt: Issues reported

.. badges-end

.. image:: https://raw.githubusercontent.com/joelb123/pytest-datadir-mgr/main/docs/_static/logo.png
   :target: https://raw.githubusercontent.com/joelb123/pytest-datadir-mgr/main/LICENSE.artwork.txt
   :alt: 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.

.. _pytest: http://pytest.org/

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/joelb123/pytest-datadir-mgr",
    "name": "pytest-datadir-mgr",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "testing,pytest-plugins,downloads,data manager,test data,software engineering",
    "author": "Joel Berendzen",
    "author_email": "joel@generisbio.com",
    "download_url": "https://files.pythonhosted.org/packages/db/2d/73c178390f4f41a1d35d82d1a67b401e2557d147afca4d48e18f3e741783/pytest_datadir_mgr-1.3.3.tar.gz",
    "platform": null,
    "description": "=============================\ndatadir-mgr plugin for pytest\n=============================\n.. badges-begin\n\n| |pypi| |Python Version| |repo| |downloads| |dlrate|\n| |license|  |build| |coverage| |codacy| |issues|\n\n.. |pypi| image:: https://img.shields.io/pypi/v/pytest-datadir-mgr.svg\n    :target: https://pypi.python.org/pypi/pytest-datadir-mgr\n    :alt: Python package\n\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/pytest-datadir-mgr\n   :target: https://pypi.python.org/pypi/pytest-datadir-mgr\n   :alt: Supported Python Versions\n\n.. |repo| image:: https://img.shields.io/github/last-commit/joelb123/pytest-datadir-mgr\n    :target: https://github.com/joelb123/pytest-datadir-mgr\n    :alt: GitHub repository\n\n.. |downloads| image:: https://pepy.tech/badge/pytest-datadir-mgr\n     :target: https://pepy.tech/project/pytest_datadir_mgr\n     :alt: Download stats\n\n.. |dlrate| image:: https://img.shields.io/pypi/dm/pytest-datadir-mgr\n   :target: https://github.com/joelb123/pytest-datadir-mgr\n   :alt: PYPI download rate\n\n.. |license| image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg\n    :target: https://github.com/joelb123/pytest-datadir-mgr/blob/master/LICENSE.txt\n    :alt: License terms\n\n.. |build| image:: https://github.com/joelb123/pytest-datadir-mgr/workflows/tests/badge.svg\n    :target:  https://github.com/joelb123/pytest-datadir-mgr.actions\n    :alt: GitHub Actions\n\n.. |codacy| image:: https://api.codacy.com/project/badge/Grade/f306c40d604f4e62b8731ada896d8eb2\n    :target: https://www.codacy.com/gh/joelb123/pytest-datadir-mgr?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=joelb123/pytest-datadir-mgr&amp;utm_campaign=Badge_Grade\n    :alt: Codacy.io grade\n\n.. |coverage| image:: https://codecov.io/gh/joelb123/pytest-datadir-mgr/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/joelb123/pytest-datadir-mgr\n    :alt: Codecov.io test coverage\n\n.. |issues| image:: https://img.shields.io/github/issues/joelb123/pytest-datadir-mgr.svg\n    :target:  https://github.com/joelb123/pytest-datadir-mgr/issues\n    :alt: Issues reported\n\n.. badges-end\n\n.. image:: https://raw.githubusercontent.com/joelb123/pytest-datadir-mgr/main/docs/_static/logo.png\n   :target: https://raw.githubusercontent.com/joelb123/pytest-datadir-mgr/main/LICENSE.artwork.txt\n   :alt: Logo credit J\u00f8rgen Stamp, published under a Creative Commons Attribution 2.5 Denmark License.\n\nThe ``datadir-mgr`` plugin for pytest_ provides the ``datadir_mgr`` fixture which\nallow test functions to easily download data files and cache generated data files\nin data directories in a manner that allows for overlaying of results. ``datadir-mgr``\nis pathlib-based, so complete paths to data files are handled,\nnot just filenames.\n\n\n\nThis plugin behaves like a limited dictionary, with ``datadir_mgr[item]`` returning a path\nwith the most specific scope (out of ``global, module, [class], [function]`` that matches\nthe string or path specified by ``item``.  In addition to serving data files already stored\nin the data directory, the fixture provides five methods useful for adding to the test data\nstored in the repository:\n\n- The ``download`` method allows downloading data files into data directories, with\n  option MD5 checksum checks, un-gzipping, and a progressbar.\n- The ``savepath`` fixture lets an arbitrary path relative to the current working\n  directory to be saved at a particular scope in the data directories.\n- The ``add_scope`` method lets one add directories from scopes different from\n  the present request to be added to the search path.  This lets the results\n  of previous cached steps to be used in scopes other than global.\n- The ``in_tmp_dir`` method creates a context in a temporary directory with\n  a list of request file paths copied in.  Optionally, all output file paths\n  can be saved at a particular scope at cleanup with an optional exclusion\n  filter pattern (e.g., for excluding log files).  Note that files in directories\n  that begin with ``test_`` or end with ``_test`` could be confused with\n  scope directories and cannnot be saved.  If ``progressbar`` is set to \"True\",\n  then the progress of file copying will be shown, which is helpful in some long-running\n  pytest jobs, e.g. on Travis.\n- The ``paths_from_scope`` returns a list of all paths to files from a specified scope.\n\n\nPrerequisites\n-------------\nPython 3.6 or greater is required.  This package is tested under Linux, MacOS, and Windows\nusing Python 3.9.\n\n.. _pytest: http://pytest.org/\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Manager for test data: downloads, artifact caching, and a tmpdir context.",
    "version": "1.3.3",
    "split_keywords": [
        "testing",
        "pytest-plugins",
        "downloads",
        "data manager",
        "test data",
        "software engineering"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "430f2416b7f488c26db9633d19775f22bfc5d53217a7a175f3de625e3d8bc4d1",
                "md5": "ab936c23e6043fd40c8fa6a43f025f25",
                "sha256": "9083243f9dc419e7447aa79e5a48e2b73f8f2e4fdef54763845c828e09e74b86"
            },
            "downloads": -1,
            "filename": "pytest_datadir_mgr-1.3.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ab936c23e6043fd40c8fa6a43f025f25",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 8546,
            "upload_time": "2023-04-06T19:37:13",
            "upload_time_iso_8601": "2023-04-06T19:37:13.289227Z",
            "url": "https://files.pythonhosted.org/packages/43/0f/2416b7f488c26db9633d19775f22bfc5d53217a7a175f3de625e3d8bc4d1/pytest_datadir_mgr-1.3.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db2d73c178390f4f41a1d35d82d1a67b401e2557d147afca4d48e18f3e741783",
                "md5": "d9b0a44a878cfb44fff79a58d25476d0",
                "sha256": "0be064fe7340f37bbebdb5b8fa9cc384d943a41cfcf3e86b88b7fc3756d3dd2c"
            },
            "downloads": -1,
            "filename": "pytest_datadir_mgr-1.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "d9b0a44a878cfb44fff79a58d25476d0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 8672,
            "upload_time": "2023-04-06T19:37:14",
            "upload_time_iso_8601": "2023-04-06T19:37:14.975464Z",
            "url": "https://files.pythonhosted.org/packages/db/2d/73c178390f4f41a1d35d82d1a67b401e2557d147afca4d48e18f3e741783/pytest_datadir_mgr-1.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-06 19:37:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "joelb123",
    "github_project": "pytest-datadir-mgr",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "pytest-datadir-mgr"
}
        
Elapsed time: 0.06453s