Skip to content

Commit

Permalink
Fix system tests so that device factories are reset after each test
Browse files Browse the repository at this point in the history
  • Loading branch information
rtuck99 committed Feb 4, 2025
1 parent be6374d commit b49e654
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1509,3 +1509,10 @@ def mock_ispyb_conn_multiscan(base_ispyb_conn):
list(range(12, 24)),
list(range(56, 68)),
)


@pytest.fixture(scope="function", autouse=True)
def clear_device_factory_caches_after_every_test(active_device_factories):
yield None
for f in active_device_factories:
f.cache_clear() # type: ignore
7 changes: 0 additions & 7 deletions tests/unit_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,3 @@ def device_factories_for_beamline(beamline_module: ModuleType) -> set[AnyDeviceF
for f in collect_factories(beamline_module, include_skipped=True).values()
if hasattr(f, "cache_clear")
}


@pytest.fixture(scope="function", autouse=True)
def clear_device_factory_caches_after_every_test(active_device_factories):
yield None
for f in active_device_factories:
f.cache_clear() # type: ignore

0 comments on commit b49e654

Please sign in to comment.