Skip to content

Commit 1d58cef

Browse files
Fix syspath in discovery unittest (#21546)
1 parent 79bb94f commit 1d58cef

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

pythonFiles/unittestadapter/discovery.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,14 @@
1212

1313
script_dir = pathlib.Path(__file__).parent.parent
1414
sys.path.append(os.fspath(script_dir))
15-
sys.path.append(os.fspath(script_dir / "lib" / "python"))
16-
17-
from typing_extensions import Literal
18-
19-
# Add the path to pythonFiles to sys.path to find testing_tools.socket_manager.
20-
PYTHON_FILES = pathlib.Path(__file__).parent.parent
21-
sys.path.insert(0, os.fspath(PYTHON_FILES))
15+
sys.path.insert(0, os.fspath(script_dir / "lib" / "python"))
2216

2317
from testing_tools import socket_manager
2418

2519
# If I use from utils then there will be an import error in test_discovery.py.
2620
from unittestadapter.utils import TestNode, build_test_tree, parse_unittest_args
2721

28-
# Add the lib path to sys.path to find the typing_extensions module.
29-
sys.path.insert(0, os.path.join(PYTHON_FILES, "lib", "python"))
30-
31-
from typing_extensions import NotRequired, TypedDict
22+
from typing_extensions import NotRequired, TypedDict, Literal
3223

3324
DEFAULT_PORT = "45454"
3425

0 commit comments

Comments
 (0)