Name | pytest-regtest JSON |
Version |
2.3.3
JSON |
| download |
home_page | None |
Summary | pytest plugin for snapshot regression testing |
upload_time | 2024-11-12 11:36:35 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
license | MIT License |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|


The full documentation for this package are available at
https://pytest-regtest.readthedocs.org
# About
## Introduction
`pytest-regtest` is a plugin for [pytest](https://pytest.org) to implement
**regression testing**.
Unlike [functional testing](https://en.wikipedia.org/wiki/Functional_testing),
[regression testing](https://en.wikipedia.org/wiki/Regression_testing)
does not test whether the software produces the correct
results, but whether it behaves as it did before changes were introduced.
More specifically, `pytest-regtest` provides **snapshot testing**, which
implements regression testing by recording data within a test function
and comparing this recorded output to a previously recorded reference
output.
## Installation
To install and activate this plugin execute:
$ pip install pytest-regtest
!!! note
`pytest-regtest` provides some functionality specific to `NumPy`,
`pandas`, and `polars`. These dependencies are not installed when
you install `pytest-regtest`. For example, if you are using NumPy
snapshots, we assume that your production code (the code under
test) uses NumPy and therefore should be part of your project's
setup.
## Use case 1: Changing code with no or little testing setup yet
If you're working with code that has little or no unit testing, you
can use regression testing to ensure that your changes don't break or
alter previous results.
**Example**:
This can be useful when working with data analysis scripts, which often
start as one long script and then are restructured into different
functions as they evolve.
## Use case 2: Testing complex data
If a unit tests contains many `assert` statements to check a complex
data structure you can use regression tests instead.
**Example**: To test code which ingests data into a database one can
use regression tests on textual database dumps.
## Use case 3: Testing NumPy arrays or pandas data frames
If your code generates numerical results, such as `NumPy` arrays,
`pandas` or `polars` data frames, you can use `pytest-regtest` to simply record such
results and test them later, taking into account relative and absolute
tolerances.
**Example**:
A function creates a 10 x 10 matrix. Either you have to write 100
assert statements or you use summary statistics to test your result.
In both cases, you may get little debugging information if a test
fails.
Raw data
{
"_id": null,
"home_page": null,
"name": "pytest-regtest",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Uwe Schmitt <uwe.schmitt@id.ethz.ch>",
"download_url": "https://files.pythonhosted.org/packages/28/83/23371f36dba27820767ad3c2a97ecd27fbfff6d8d396a7d850694aa9c2c4/pytest_regtest-2.3.3.tar.gz",
"platform": null,
"description": "\n\n\n\nThe full documentation for this package are available at\nhttps://pytest-regtest.readthedocs.org\n\n# About\n\n## Introduction\n\n`pytest-regtest` is a plugin for [pytest](https://pytest.org) to implement\n**regression testing**.\n\nUnlike [functional testing](https://en.wikipedia.org/wiki/Functional_testing),\n[regression testing](https://en.wikipedia.org/wiki/Regression_testing)\ndoes not test whether the software produces the correct\nresults, but whether it behaves as it did before changes were introduced.\n\nMore specifically, `pytest-regtest` provides **snapshot testing**, which\nimplements regression testing by recording data within a test function\nand comparing this recorded output to a previously recorded reference\noutput.\n\n\n## Installation\n\nTo install and activate this plugin execute:\n\n $ pip install pytest-regtest\n\n\n!!! note\n\n `pytest-regtest` provides some functionality specific to `NumPy`,\n `pandas`, and `polars`. These dependencies are not installed when\n you install `pytest-regtest`. For example, if you are using NumPy\n snapshots, we assume that your production code (the code under\n test) uses NumPy and therefore should be part of your project's\n setup.\n\n\n## Use case 1: Changing code with no or little testing setup yet\nIf you're working with code that has little or no unit testing, you\ncan use regression testing to ensure that your changes don't break or\nalter previous results.\n\n**Example**:\nThis can be useful when working with data analysis scripts, which often\nstart as one long script and then are restructured into different\nfunctions as they evolve.\n\n\n## Use case 2: Testing complex data\nIf a unit tests contains many `assert` statements to check a complex\ndata structure you can use regression tests instead.\n\n**Example**: To test code which ingests data into a database one can\nuse regression tests on textual database dumps.\n\n## Use case 3: Testing NumPy arrays or pandas data frames\n\nIf your code generates numerical results, such as `NumPy` arrays,\n`pandas` or `polars` data frames, you can use `pytest-regtest` to simply record such\nresults and test them later, taking into account relative and absolute\ntolerances.\n\n\n**Example**:\nA function creates a 10 x 10 matrix. Either you have to write 100\nassert statements or you use summary statistics to test your result.\nIn both cases, you may get little debugging information if a test\nfails.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "pytest plugin for snapshot regression testing",
"version": "2.3.3",
"project_urls": {
"Documentation": "https://pytest-regtest.readthedocs.org",
"Source": "https://gitlab.com/uweschmitt/pytest-regtest"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2da4c3a0378806bddbf302cef7522c2f4e67e2bd3b57c4a6dcea700560c743f7",
"md5": "3269d08887e017c0a320de298d1b050a",
"sha256": "24cc93d457d62da154dd3d4f0fb23fb540f407dc588cfb853e923001235ea8e5"
},
"downloads": -1,
"filename": "pytest_regtest-2.3.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3269d08887e017c0a320de298d1b050a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17413,
"upload_time": "2024-11-12T11:36:33",
"upload_time_iso_8601": "2024-11-12T11:36:33.879018Z",
"url": "https://files.pythonhosted.org/packages/2d/a4/c3a0378806bddbf302cef7522c2f4e67e2bd3b57c4a6dcea700560c743f7/pytest_regtest-2.3.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "288323371f36dba27820767ad3c2a97ecd27fbfff6d8d396a7d850694aa9c2c4",
"md5": "dbc8b506e0b19d7e48d05c0947081294",
"sha256": "e294a8febd8821937cd2b62010d05b731af1b9f90692bc60690cb0307e38d9f1"
},
"downloads": -1,
"filename": "pytest_regtest-2.3.3.tar.gz",
"has_sig": false,
"md5_digest": "dbc8b506e0b19d7e48d05c0947081294",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22222,
"upload_time": "2024-11-12T11:36:35",
"upload_time_iso_8601": "2024-11-12T11:36:35.231915Z",
"url": "https://files.pythonhosted.org/packages/28/83/23371f36dba27820767ad3c2a97ecd27fbfff6d8d396a7d850694aa9c2c4/pytest_regtest-2.3.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-12 11:36:35",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "uweschmitt",
"gitlab_project": "pytest-regtest",
"lcname": "pytest-regtest"
}