From 69a3bc5e31959bcebc161288f3edf64847ad7aff Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 10 Apr 2023 15:10:39 +0200 Subject: [PATCH] Fixed cwd handling --- unittests/unittests_cli/abc/command_test_case.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unittests/unittests_cli/abc/command_test_case.py b/unittests/unittests_cli/abc/command_test_case.py index 754fa9dc..4bf1cd7b 100644 --- a/unittests/unittests_cli/abc/command_test_case.py +++ b/unittests/unittests_cli/abc/command_test_case.py @@ -8,6 +8,7 @@ from unittests_cli.constants import PLAYGROUND_PATH class CommandTestCase(unittest.TestCase): _skip_tear_down = False + _cwd = os.getcwd() def __init__(self, method_name: str): unittest.TestCase.__init__(self, method_name) @@ -32,6 +33,7 @@ class CommandTestCase(unittest.TestCase): if cls._skip_tear_down: return try: + os.chdir(cls._cwd) if os.path.exists(PLAYGROUND_PATH): shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH))) except Exception as e: