Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""

import os
import pathlib
import traceback
import warnings

Expand Down Expand Up @@ -172,14 +171,13 @@ def reinitialise_error_module():


@pytest.fixture(autouse=True) # noqa: RUF076
def return_to_root():
def return_to_root(request):
"""Various parts of PROCESS change directories and do not always change back.
This fixture ensures that, at the end of each test, the cwd is reset to what it
was at the beginning of the test.
"""
cwd = pathlib.Path.cwd()
yield
os.chdir(cwd)
os.chdir(request.config.invocation_dir)


@pytest.fixture(autouse=True) # noqa: RUF076
Expand Down
Loading