https://github.com/ngriffiths13/photoshoot
A pytest plugin library for doing snapshot testing with Polars DataFrames.
https://github.com/ngriffiths13/photoshoot
Last synced: 2 months ago
JSON representation
A pytest plugin library for doing snapshot testing with Polars DataFrames.
- Host: GitHub
- URL: https://github.com/ngriffiths13/photoshoot
- Owner: ngriffiths13
- License: mit
- Created: 2024-08-17T02:49:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-20T03:14:17.000Z (about 1 year ago)
- Last Synced: 2025-08-17T19:45:19.893Z (3 months ago)
- Language: Python
- Size: 16.6 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-polars - photoshoot - A pytest plugin library for doing snapshot testing with Polars DataFrames by [@ngriffiths13](https://github.com/ngriffiths13). (Libraries/Packages/Scripts / Polars plugins)
README
# photoshoot
Photoshoot is a pytest plugin libary for making snapshot testing with Polars DataFrames easy.
## Installation
```bash
pip install photoshoot
```
## Usage
On the first run of this test, it will fail. Because no previous snapshot has been created.
```python
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.
```bash
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.