diff --git a/python_files/unittestadapter/execution.py b/python_files/unittestadapter/execution.py index 9394303b69a1..6b9252906477 100644 --- a/python_files/unittestadapter/execution.py +++ b/python_files/unittestadapter/execution.py @@ -171,6 +171,11 @@ def run_tests( locals: Optional[bool] = None, ) -> PayloadDict: cwd = os.path.abspath(start_dir) + if "/" in start_dir: # is a subdir + parent_dir = os.path.dirname(start_dir) + sys.path.insert(0, parent_dir) + else: + sys.path.insert(0, cwd) status = TestExecutionStatus.error error = None payload: PayloadDict = {"cwd": cwd, "status": status, "result": None}