Skip to main content

A pytest plugin for snapshot testing polars dataframes.

Project description

photoshoot

Photoshoot is a pytest plugin libary for making snapshot testing with Polars DataFrames easy.

Installation

pip install photoshoot

Usage

On the first run of this test, it will fail. Because no previous snapshot has been created.

import pytest
import polars as pl

def test_dataframe(local_snapshot):
    df = pl.DataFrame({
        "a": [1, 2, 3],
        "b": [4, 5, 6],
    })
    local_snapshot(df)

Running the test like this, will create a snapshot of the dataframe. All future runs will compare the dataframe with the snapshot.

pytest --new-snapshot

Rerunning the test now will pass, as the snapshot is already created.

Features

Currenty this library only supports Polars DataFrames, and only supports local snapshots or gcs snapshots.

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

photoshoot-0.2.1.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

photoshoot-0.2.1-py3-none-any.whl (7.0 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