moo.conftest.pytest_collection_modifyitems
- moo.conftest.pytest_collection_modifyitems(config, items)
Add
serialized_rollback=Trueto tx tests using thedefaultdataset.The
moo.bootstrapseed migration loadsdefault/bootstrap.pyonce during test DB setup; pytest-django serializes that state. Tests parametrized witht_init=["default"]benefit from restoring the snapshot rather than re-runningload_pythonper test.Tests using the minimal
testdataset (or no parametrize) don’t get the marker — deserializing the full default snapshot is slower than runningtest.pyAND 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.