Skip to content

Commit 2090f23

Browse files
committed
fix typing
1 parent 83256eb commit 2090f23

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

pythonFiles/unittestadapter/discovery.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
import sys
99
import traceback
1010
import unittest
11-
from typing import List, Literal, Optional, Tuple, Union
11+
from typing import List, Optional, Tuple, Union
12+
13+
script_dir = pathlib.Path(__file__).parent.parent
14+
sys.path.append(os.fspath(script_dir))
15+
sys.path.append(os.fspath(script_dir / "lib" / "python"))
16+
17+
from typing_extensions import Literal
1218

1319
# Add the path to pythonFiles to sys.path to find testing_tools.socket_manager.
1420
PYTHON_FILES = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

pythonFiles/unittestadapter/utils.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66
import inspect
77
import os
88
import pathlib
9+
import sys
910
import unittest
10-
from typing import List, Tuple, TypedDict, Union
11+
from typing import List, Tuple, Union
12+
13+
script_dir = pathlib.Path(__file__).parent.parent
14+
sys.path.append(os.fspath(script_dir))
15+
sys.path.append(os.fspath(script_dir / "lib" / "python"))
16+
17+
from typing_extensions import TypedDict
1118

1219
# Types
1320

pythonFiles/vscode_pytest/run_pytest_script.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
import pathlib
77
import socket
88
import sys
9+
from typing import List
910

1011
import pytest
1112

1213
CONTENT_LENGTH: str = "Content-Length:"
1314

1415

15-
def process_rpc_json(data: str) -> list[str]:
16+
def process_rpc_json(data: str) -> List[str]:
1617
"""Process the JSON data which comes from the server which runs the pytest discovery."""
1718
str_stream: io.StringIO = io.StringIO(data)
1819

0 commit comments

Comments
 (0)