DiamondLightSource / DiamondLightSource/dodal
Fix path provider persistence issues in tests
- Dominant language
- Python
- Stars
- 5
- Forks
- 13
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 10
Description
While working on something else I noticed there were issues with persisted state for the global `PATH_PROVIDER`. I tried to add a cleanup for this but it is worth its own PR:
Something like this in `common/beamlines/beamline_utils` :
```
def clear_path_provider():
if "PATH_PROVIDER" in globals():
global PATH_PROVIDER
del PATH_PROVIDER
```
and a cleanup fixture in conftest.
```
@pytest.fixture(autouse=True)
def path_provider_cleanup():
yield
beamline_utils.clear_path_provider()
```
## Acceptance Criteria
* The tests don't rely on accidentally persisted state, and the setting of globals is explicit
Contributor guide
Assessment
This issue has not been assessed yet.