Skip to main content

No project description provided

Project description

PySnapTest

pysnaptest is a Python wrapper for the powerful Insta library written in Rust. It brings the simplicity and performance of snapshot testing from Rust to Python, enabling developers to quickly and easily test complex outputs, including strings, JSON, and other serializable data.

Snapshot testing helps ensure that your code produces consistent outputs as you make changes. By capturing the output of your code and comparing it to a stored "snapshot," you can detect unintended changes with ease.

Features

  • Fast and Lightweight: Leverages Rust's high performance through the Insta library.
  • Simple Integration: Easy-to-use Python API for snapshot testing.
  • Human-Readable Snapshots: Snapshots are stored in a clean, readable format.
  • Flexible Matchers: Supports testing strings, JSON, and other data structures.
  • Automatic Snapshot Updates: Conveniently update snapshots when intended changes are made.
  • CI-Friendly: Great for continuous integration workflows.

Installation

You can install pysnaptest via pip:

pip install pysnaptest

Updating Snapshots

If the output changes intentionally, you can review and update snapshots using the cargo-insta review command. This provides an interactive workflow to inspect changes and accept or reject updates.

Running Snapshot Review

You can install cargo-insta binaries from cargo-insta. After that you should be able to review snapshots with the following:

cargo-insta review

This command allows you to inspect differences and choose which snapshots to update.

Examples

To help you get started, we’ve included a collection of examples in the examples folder. These examples demonstrate how to use pysnaptest in toy projects and cover common use cases like snapshotting strings, JSON, and other data structures.

To try them out:

cd examples/my_project
pytest

Feel free to explore, modify, and build upon these examples for your own projects!

Contributing

We welcome contributions to pysnaptest! To get started:

  1. Fork the repository.
  2. Create a new branch for your feature or fix.
  3. Submit a pull request with a clear description of your changes.

License

pysnaptest is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Acknowledgments

This library is inspired by and built upon the excellent Insta library. A big thank you to the Insta team for creating such a fantastic tool!

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

pysnaptest-0.1.2.tar.gz (12.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pysnaptest-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (657.0 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pysnaptest-0.1.2-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (696.2 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ i686

pysnaptest-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (655.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pysnaptest-0.1.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (692.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686

pysnaptest-0.1.2-cp312-cp312-win_amd64.whl (512.6 kB view details)

Uploaded CPython 3.12Windows x86-64

pysnaptest-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (654.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pysnaptest-0.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (692.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

pysnaptest-0.1.2-cp311-cp311-win_amd64.whl (513.1 kB view details)

Uploaded CPython 3.11Windows x86-64

pysnaptest-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (656.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pysnaptest-0.1.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (695.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

pysnaptest-0.1.2-cp310-cp310-win_amd64.whl (513.1 kB view details)

Uploaded CPython 3.10Windows x86-64

pysnaptest-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (656.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pysnaptest-0.1.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (695.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

pysnaptest-0.1.2-cp39-cp39-win_amd64.whl (513.1 kB view details)

Uploaded CPython 3.9Windows x86-64

pysnaptest-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (656.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pysnaptest-0.1.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (695.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686

pysnaptest-0.1.2-cp38-cp38-win_amd64.whl (513.1 kB view details)

Uploaded CPython 3.8Windows x86-64

pysnaptest-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (656.5 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

pysnaptest-0.1.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (695.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ i686

File details

Details for the file pysnaptest-0.1.2.tar.gz.

File metadata

  • Download URL: pysnaptest-0.1.2.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.4

File hashes

Hashes for pysnaptest-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9a8193df27d4a50639d9c7b9d31fd7d545ff7bf5d495b251e8bd08c3456230ec
MD5 4d831128a18e4660ddc1bad0b82835f4
BLAKE2b-256 c73699bc2d118c90c5e817adb7a023e0eed96da1b1d824633e4fda6a9f426602

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 acdce745147c40e27994a601b9586059b2d51ef9c7afc31112682e1d2056ae9d
MD5 39dd73350ba0cc974d0c01142c2ca145
BLAKE2b-256 14a0e053e12c752c14ff5e05d47cb592c127fd397a95c260d3784d1ae9c3c03f

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c132ec382911f45f8aa340868f09c263600311fd1203ed21f5e1ad5687cfc09c
MD5 5bf133f09414cd7b1a13b801edcac84b
BLAKE2b-256 f6034bf757ea18b8d9ec980121968cdda96c37ee3f66ca5fc310a8c9def81f01

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8dd37e1053b20c7f7de3f457629a48d15b1b56efe665bec0b62121ef7310d7df
MD5 695896d1f2fdf83181b0bfde0872ef7c
BLAKE2b-256 8738410d68497937c61e882bd069edbee848645d743e304944423c0969e13402

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b290246c661046e3f35237ff64c73b6c1dd9f9aaa45db66ec4e1018a52e69bc5
MD5 4d520823dfe762c780d13a76606ab03b
BLAKE2b-256 cfa25a4b9b0eb0deaa7afd499fe04c0ba88e7f3322aec3373a2fe158a1f9200c

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pysnaptest-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 512.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.4

File hashes

Hashes for pysnaptest-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ac9ddb7a795c14e0e6c990edbb7e59ff319e49e4e4d2ae96be0ca3195db667c4
MD5 ac88fc254fba68c148d129c5a40b29ee
BLAKE2b-256 7de1123ebc7ebe4a22954bd720e6c545460974778003ad60906c41d36c21a049

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98b286fa3673770ba97e3a9c330bf367f344ad75f7037b946f4bbb23ea4232aa
MD5 37877bdd4a32a84a9688c5d9411c99d4
BLAKE2b-256 784202d45ca68de38412b03181ca2d57f1de57084dc666a74b91d30bc194ca79

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 46f0a5ed7f201cef85eac398b69f6796aa25d7badf82f71096da9a96b01a167b
MD5 c1eaac91cc79dc78e5e297a32acf9013
BLAKE2b-256 13a4ec519ba562c0da8b6cba46f7be75ab81311fef5bcb02c2032bfe5b5caae2

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pysnaptest-0.1.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 513.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.4

File hashes

Hashes for pysnaptest-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 221c0a5f75f70f677cec1f8a98f9726c6b896f8af152d6208041acac4989ac26
MD5 476c356ee449e695295b2c43226b7df0
BLAKE2b-256 7587c4b973432e9071c78fa6f70e869fea0af61f2ad27683134af4376d9d993f

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 140d3dacf0f0e66ab190123d1c784cebda28e11159e2889bc7c02b81523b19cf
MD5 161997d43c159aa8085b590e60b27e72
BLAKE2b-256 4dc9ebc2394ed29bef81ed2843539364f4cf4acfa4b6e90dc890482e7c61d95d

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a2df77d8fad42577ca1d7f6cb03dcd0bbb557e58cddc2128b8de38889fabe62f
MD5 5e87fd8e6e67d0b103340c86eb8625d7
BLAKE2b-256 e739d3fcbc3a0c2864a0bbdb85bf885145e3d76f284ebe13eb3c1f1c678efe4c

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pysnaptest-0.1.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 513.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.4

File hashes

Hashes for pysnaptest-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8631c8bdd7ef13ad86cbd3c80f47c2300a9f05c26f44d544523faf5ee917c0e1
MD5 e2ca65d5de0c082c41835f348f3d859b
BLAKE2b-256 f257ae3ae0643a5e495d8adaed18bca1f384e0107b4171ffdcdcc3cef1be888b

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16b56a7cccfce22d3fae937cc42256b40b0594454bd2cc2dba8b10d143c777b2
MD5 5fd3f8a2f27611330b311e03e8a5b925
BLAKE2b-256 28ffc30dff2b5ba272afc632116ef5ef8c8e921a5586d8305bffd9c5868d46fb

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2d5e34658febb9c1ea815708e570ab1fd85a435b5b863b0de00c92d908637bcb
MD5 fef3eadf01b8548ca4d928379a90fc43
BLAKE2b-256 83a4d82803fbad736424321a7e400b6c8628f09992f5e6b2f78d5c98e85b7f6f

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pysnaptest-0.1.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 513.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.4

File hashes

Hashes for pysnaptest-0.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 68ac98ba2bd689b400777393758040fa3c9f0dc0a7224b0e81d3004618a2ba70
MD5 3457e37a4dc04892557672c1de9d01e8
BLAKE2b-256 5ac888bfd4d91efe2dd46925b7fec7fd4ee47b9350c7a8dc1a6f1a40205d525a

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d54a70f6a18b1894945edecddc2d9ceefc36c0a13bcdaf94b7c9ae18fd2e59a7
MD5 c52ddd11101646b93212c0e6ff208f39
BLAKE2b-256 8d39cb9da6483b1d01bae34f4d8009b88903099bf4f65daa5a2fe67e66d488a0

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 637f6c7596bc17702121a7466b9d0478d090f080fc49ee788ad382bb72b48dae
MD5 d0a0e98c0a35d4e99cec8ab2d4573983
BLAKE2b-256 1b1bfb069571f8a5ad752896af41ae2e153386c04925dd76745c0e209e6fa091

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pysnaptest-0.1.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 513.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.4

File hashes

Hashes for pysnaptest-0.1.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8193eab9ed9c084a9c176a05080c6014406fb6f4e3a88561a4c6671709eb7e93
MD5 d8ea444032bfe8d3d3483e56cc74d76d
BLAKE2b-256 b62b80bb1804175da7cd9b0ec83528152dfdaa542ad5b87604c98e86a3e36890

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8892e5e50303d97757c2062cfc67943275ec99580b78734d2e3dbe25f2959ec6
MD5 7faf90b51a05ed4d064c41c5b38d7374
BLAKE2b-256 6f9f405e0351e52cc92f981536d31f02e3282ce47b1f885033244045b184f56e

See more details on using hashes here.

File details

Details for the file pysnaptest-0.1.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pysnaptest-0.1.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 bbcedf058d10c46ae122cb6b41edebac73c3409f5d3f673066ebdf56edd113cf
MD5 f88f007b0f273dd5c7951f006fbfb824
BLAKE2b-256 9b943a13b30792a3523e0a97ea1f27392f9f5be4a58971b0de35a0d125467aa4

See more details on using hashes here.

Supported by

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