Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use pytest-insta to manage snapshots #299

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JamesGuthrie
Copy link
Member

This change uses pytest-insta to manage snapshot tests.

pytest-insta integrates seamlessly with pytest. When the output of a snapshotted test changes, the test fails.

If you're expecting the changes and want to update the snapshot, run pytest --insta update.

To review the changes on an individual basis, run pytest --insta review.

To view the new snapshot output, run pytest --insta record, this outputs the path to the file containing the new snapshot:

> pytest --insta record -k test_contents
=========================== test session starts ============================
platform linux -- Python 3.10.15, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/james/workspace/pgai/projects/extension
configfile: pyproject.toml
plugins: insta-0.3.0, anyio-4.7.0
collected 112 items / 111 deselected / 1 skipped / 1 selected

tests/contents/test_contents.py .                                    [100%]

================================ SNAPSHOTS =================================
RECORD .pytest_cache/d/insta/tests/contents/contents__contents__pg17.txt

NOTICE 1 snapshot to review
=============== 1 passed, 1 skipped, 111 deselected in 0.39s ===============

@JamesGuthrie JamesGuthrie requested a review from a team as a code owner December 12, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant