moo.conftest.pytest_collection_modifyitems

moo.conftest.pytest_collection_modifyitems(config, items)

Add serialized_rollback=True to tx tests using the default dataset.

The moo.bootstrap seed migration loads default/bootstrap.py once during test DB setup; pytest-django serializes that state. Tests parametrized with t_init=["default"] benefit from restoring the snapshot rather than re-running load_python per test.

Tests using the minimal test dataset (or no parametrize) don’t get the marker — deserializing the full default snapshot is slower than running test.py AND would change their semantics (they’d see the full default world instead of a minimal sentinel-only DB). Tests parametrized to a non-default dataset also opt out.

Tests that must run against a freshly-uninitialized DB (i.e. test the bootstrap mechanism itself) opt out via pytestmark.no_default_snapshot; the loop below honors that opt-out.