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
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 hashes)
Built Distribution
Close
Hashes for pytest_ditto-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63ba8674c8c5d39aba6599e7058286f1bb242d349f3e11f12380132058726c3 |
|
MD5 | 64dffa6b3c9fca50f6f85c24ad9c597a |
|
BLAKE2b-256 | 90025001f188495f890233c5a5dc43bc7923bc7ec1bb934f7f6e3bb9da227151 |