1. TL;DR example
STEP 1
Write this code:
File tests/some_module.py
@pytest.mark.record_curl
@pytest.mark.record_ftp
@pytest.mark.record_http
@pytest.mark.record_time
@pytest.mark.record_verify_screen
def test_some_test(record):
some_python_object = ...
record.add_verify(object=some_python_object)
STEP 2
Run:
pytest tests/some_module.py --record
It will:
Save all the Curl and urllib3 requests, as well as interactions with ftplib.
Save the execution datetime
Save the screen output
Save the data you provide to recorder object
STEP 3
Run:
pytest tests/some_module.py
It will:
Reuse the stored Curl and urllib3 requests
Reuse the same datetime to execute the test
Compare the current screen output to the previous one and raise and exception if different
Compare the current recorder object data to the previous one and raise and exception if different
2. Detailed example
CODE
@pytest.mark.record_curl
@pytest.mark.record_http
@pytest.mark.record_time(date=datetime(2023, 3, 1, 12, 0, 0), tic=False)
@pytest.mark.record_verify_screen(hash=True)
def test_some_test(record):
...
record.hash_only = True
record.add_verify(object=df)
record.add_verify(object=[df])
recorder.add_verify(
object=df,
)
USAGE
pytest [FILE] [--record[=none,all,curl,ftp,http,object,screen,time]] [--record-no-overwrite] [--record-no-hash]
FILES
For a given test_function from test_module, we will have the following files:
/tests/test_module.py:test_function
/tests/record/curl/test_module/test_function.yaml
/tests/record/ftp/test_module/test_function.yaml
/tests/record/http/test_module/test_function.yaml
/tests/record/object/test_module/test_function.json
/tests/record/object_hash/test_module/test_function.txt/json?
/tests/record/screen/test_module/test_function.txt/json?
/tests/record/screen_hash/test_module/test_function.txt/json?
/tests/record/time/test_module/test_function.txt/json?
Metadata
Release files for pytest-recorder 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytest_recorder-1.0.0.tar.gz | 17.0 kB | Without provenance | Details for pytest_recorder-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_recorder-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pytest_recorder-1.0.0-py3-none-any.whl |
Total release size: 39.0 kB
Release files / pytest_recorder-1.0.0.tar.gz
| Download URL | pytest_recorder-1.0.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1aebcb0b7c824b61bc0bc9a58f7aca84912a94da312d986c6cd0847a1c38d42e
|
|
BLAKE2b-256 checksum How to use checksums |
9a8a9c4fdf06777275fbc9d29b51153925a7cf7449d89439036de8e06daf454a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.13.11 Darwin/25.6.0
|
Release files / pytest_recorder-1.0.0-py3-none-any.whl
| Download URL | pytest_recorder-1.0.0-py3-none-any.whl |
|---|---|
| Size | 22.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb60f8cd2a836e9515db45f5fd5781798cc6ed6cee5994675322034fc762a7aa
|
|
BLAKE2b-256 checksum How to use checksums |
22b24234dbe4c5605c5be3ef9b882db0f07b4afb240ac762fef8f281816bf291
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.13.11 Darwin/25.6.0
|
Security for pytest-recorder 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.