diff --git a/doc/changelog.d/4115.miscellaneous.md b/doc/changelog.d/4115.miscellaneous.md new file mode 100644 index 000000000000..1232bfb8ef86 --- /dev/null +++ b/doc/changelog.d/4115.miscellaneous.md @@ -0,0 +1 @@ +Run each test in its own directory \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index 549d2ad9d8a2..b54d8b1d1acb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -170,12 +170,18 @@ def pytest_collection_finish(session): @pytest.fixture(autouse=True) def run_before_each_test( - monkeypatch: pytest.MonkeyPatch, request: pytest.FixtureRequest -) -> None: + tmp_path, + monkeypatch: pytest.MonkeyPatch, + request: pytest.FixtureRequest, +): monkeypatch.setenv("PYFLUENT_TEST_NAME", request.node.name) monkeypatch.setenv("PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS", "1") pyfluent.CONTAINER_MOUNT_SOURCE = pyfluent.EXAMPLES_PATH pyfluent.CONTAINER_MOUNT_TARGET = pyfluent.EXAMPLES_PATH + original_cwd = os.getcwd() + monkeypatch.chdir(tmp_path) + yield + os.chdir(original_cwd) class Helpers: