The order of tests matters, with some tests failing if the order is changed. As pytest does not isolate the environment between tests, some state can persist and influence the result of subsequent tests.
Initialising flags should be done each time and care should be taken when modifying/mocking of imports - as these may persist across suites(?).