Snapshot testing pytest plugin with minimal ceremony and flexible persistence formats.
Project description
pytest-ditto
Snapshot testing pytest plugin with minimal ceremony and flexible persistence formats.
Usage
pd.DataFrame
import pandas as pd
import ditto
def awesome_fn_to_test(df: pd.DataFrame):
df["a"] *= 2
return df
@ditto.record("pandas_parquet")
def test_save_pandas_dataframe(snapshot):
input_data = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 9]})
result = awesome_fn_to_test(input_data)
pd.testing.assert_frame_equal(result, snapshot(result, key="ab_dataframe"))
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
pytest_ditto-0.0.3.tar.gz
(5.2 kB
view details)
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_ditto-0.0.3.tar.gz.
File metadata
- Download URL: pytest_ditto-0.0.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69455d28032de039bcb09f9f47c4bdf77f47d95179b1333ff24d8844c668bb2f
|
|
| MD5 |
9016d5f57852203cc077ed7b0cbd3556
|
|
| BLAKE2b-256 |
b2f98a812c1d46dfb4adbbbec9133a2faab6fbd2f39aafb4ffb778995fd5a059
|
File details
Details for the file pytest_ditto-0.0.3-py3-none-any.whl.
File metadata
- Download URL: pytest_ditto-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f63ba8674c8c5d39aba6599e7058286f1bb242d349f3e11f12380132058726c3
|
|
| MD5 |
64dffa6b3c9fca50f6f85c24ad9c597a
|
|
| BLAKE2b-256 |
90025001f188495f890233c5a5dc43bc7923bc7ec1bb934f7f6e3bb9da227151
|