ditto update¶
Re-run pytest with --ditto-update to re-record snapshots.
Every snapshot the run reaches is overwritten with the current value. A full, passing run also rebuilds ditto.lock. Any extra arguments are passed directly to pytest.
Usage:
Options:
Examples¶
# Update all snapshots
ditto update
# Update snapshots in a specific directory
ditto update tests/ci/
# Update specific tests
ditto update tests/ci/ -k test_foo
Screenshot¶
Behaviour¶
- Runs pytest with
--ditto-updateflag - Every snapshot encountered during the run is re-recorded from current output
- Existing snapshot files are overwritten
- New snapshots are created as normal
Tip
After updating, review the diff in version control to verify the changes are intentional.