Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
# Using syrupy (pytest plugin) pip install syrupy from syrupy.assertion import SnapshotAssertion def test_api_response(snapshot: SnapshotAssertion): resp = client.get("/api/users") assert resp.json() == snapshot # Update snapshots when output intentionally changes: # pytest --snapshot-update
Result
Open