Record and play back your expectations
Project description
pytest-expected
This pytest fixture lets you write tests that compare to a previously known, recorded value:
def test_something(expected):
assert something(frobnicate=True) == expected
When called with --record, pytest will accept any value and store it in a
file in the hidden .expected directory under the pytest root folder (usually
the repository root).
When called without --record, it will load the known value(s) from that
store, and assert that they are equal to the observed values.
Any picklable value can be stored.
You can also use expected several times in a test for different values, and
it'll figure out the rest.
pytest-expected organizes storage based on:
- Test ID (typically includes path to test file, test name, and parametrizations)
- Number of uses of
expected
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_expected-0.1.1.tar.gz.
File metadata
- Download URL: pytest_expected-0.1.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab8529d2ab660c4ea5ed0897596e56dc15dada064af0df96b2047640186e9890
|
|
| MD5 |
3c22b3066afcef4452b559bb5c8a6377
|
|
| BLAKE2b-256 |
2c7616d36c5c0337000cd65c18ce46be2db8ca5745f5c2099b72dea2433ed8b2
|
File details
Details for the file pytest_expected-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pytest_expected-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29cac09773ba5b259341d382ade8bf61ab8052408c8a440fdb4e9630a9632605
|
|
| MD5 |
15c3ca62d7b2f88d3332618848b98cdc
|
|
| BLAKE2b-256 |
0fb4e8bce23fc83431a05ff0bed6594ae5f450df625bca9f99a00ac23ce57a35
|