Skip to content

Commit af7eb56

Browse files
authored
update to align with sys path appends (#21547)
changes to align with #21546
1 parent 1d58cef commit af7eb56

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

pythonFiles/tests/unittestadapter/test_execution.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
import pytest
1010

11-
PYTHON_FILES = pathlib.Path(__file__).parent.parent
11+
script_dir = pathlib.Path(__file__).parent.parent
12+
sys.path.insert(0, os.fspath(script_dir / "lib" / "python"))
1213

13-
sys.path.insert(0, os.fspath(PYTHON_FILES))
1414
from unittestadapter.execution import parse_execution_cli_args, run_tests
1515

1616
TEST_DATA_PATH = pathlib.Path(__file__).parent / ".data"

pythonFiles/unittestadapter/execution.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
from types import TracebackType
1414
from typing import Dict, List, Optional, Tuple, Type, Union
1515

16-
directory_path = pathlib.Path(__file__).parent.parent / "lib" / "python"
17-
# Add the path to pythonFiles to sys.path to find testing_tools.socket_manager.
18-
PYTHON_FILES = pathlib.Path(__file__).parent.parent
16+
script_dir = pathlib.Path(__file__).parent.parent
17+
sys.path.append(os.fspath(script_dir))
18+
sys.path.insert(0, os.fspath(script_dir / "lib" / "python"))
1919

20-
sys.path.insert(0, os.fspath(PYTHON_FILES))
21-
# Add the lib path to sys.path to find the typing_extensions module.
22-
sys.path.insert(0, os.path.join(PYTHON_FILES, "lib", "python"))
2320
from testing_tools import process_json_util, socket_manager
2421
from typing_extensions import NotRequired, TypeAlias, TypedDict
2522
from unittestadapter.utils import parse_unittest_args

0 commit comments

Comments
 (0)