Skip to main content

Snapshot testing pytest plugin with minimal ceremony and flexible persistence formats.

Project description

pytest-ditto

PyPI version Continuous Integration

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)

Uploaded Source

Built Distribution

pytest_ditto-0.0.3-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page