Skip to content

Commit aa216f2

Browse files
authored
Audit fix and some clean up (#23599)
1 parent 40fd53b commit aa216f2

File tree

4 files changed

+91
-77
lines changed

4 files changed

+91
-77
lines changed

package-lock.json

Lines changed: 79 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python_files/tests/unittestadapter/test_execution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
import pathlib
66
import sys
77
from unittest.mock import patch
8-
from typing import Dict
8+
from typing import Dict, Optional
99

1010
import pytest
1111

1212
script_dir = pathlib.Path(__file__).parent.parent.parent
1313
sys.path.insert(0, os.fspath(script_dir / "lib" / "python"))
1414

15-
from unittestadapter.pvsc_utils import ExecutionPayloadDict, TestResultTypeAlias # noqa: E402
15+
from unittestadapter.pvsc_utils import ExecutionPayloadDict # noqa: E402
1616
from unittestadapter.execution import run_tests # noqa: E402
1717

1818
TEST_DATA_PATH = pathlib.Path(__file__).parent / ".data"
@@ -64,7 +64,7 @@ def test_single_ids_run(mock_send_run_data):
6464
test_actual = args[0] # first argument is the result
6565

6666
assert test_actual
67-
actual_result: TestResultTypeAlias | None = actual["result"]
67+
actual_result: Optional[Dict[str, Dict[str, Optional[str]]]] = actual["result"]
6868
if actual_result is None:
6969
raise AssertionError("actual_result is None")
7070
else:

python_files/unittestadapter/pvsc_utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
import pathlib
1111
import sys
1212
import unittest
13-
from typing import List, Optional, Tuple, Union, Dict
13+
from typing import List, Optional, Tuple, Union, Dict, Literal, TypedDict
1414

1515

1616
script_dir = pathlib.Path(__file__).parent.parent
1717
sys.path.append(os.fspath(script_dir))
1818
sys.path.append(os.fspath(script_dir / "lib" / "python"))
1919

2020
from testing_tools import socket_manager # noqa: E402
21-
from typing_extensions import Literal, NotRequired, TypeAlias, TypedDict # noqa: E402
21+
from typing_extensions import NotRequired # noqa: E402
2222

2323
# Types
2424

@@ -52,9 +52,6 @@ class TestExecutionStatus(str, enum.Enum):
5252
success = "success"
5353

5454

55-
TestResultTypeAlias: TypeAlias = Dict[str, Dict[str, Union[str, None]]]
56-
57-
5855
class VSCodeUnittestError(Exception):
5956
"""A custom exception class for unittest errors."""
6057

@@ -72,7 +69,7 @@ class DiscoveryPayloadDict(TypedDict):
7269
class ExecutionPayloadDict(TypedDict):
7370
cwd: str
7471
status: TestExecutionStatus
75-
result: Optional[TestResultTypeAlias]
72+
result: Optional[Dict[str, Dict[str, Optional[str]]]]
7673
not_found: NotRequired[List[str]]
7774
error: NotRequired[str]
7875

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ microvenv==2023.5.post1 \
1212
--hash=sha256:32c46afea874e300f69f1add0806eb0795fd02b5fb251092fba0b73c059a7d1f \
1313
--hash=sha256:fd79b3dfea7860e2e84c87dd0aa8a135075f7fa2284174842b7bdeb077a0d8ac
1414
# via -r requirements.in
15-
packaging==24.0 \
16-
--hash=sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5 \
17-
--hash=sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9
15+
packaging==24.1 \
16+
--hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \
17+
--hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124
1818
# via -r requirements.in
1919
tomli==2.0.1 \
2020
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
@@ -24,7 +24,7 @@ typing-extensions==4.12.1 \
2424
--hash=sha256:6024b58b69089e5a89c347397254e35f1bf02a907728ec7fee9bf0fe837d203a \
2525
--hash=sha256:915f5e35ff76f56588223f15fdd5938f9a1cf9195c0de25130c627e4d597f6d1
2626
# via -r requirements.in
27-
zipp==3.15.0 \
28-
--hash=sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b \
29-
--hash=sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556
27+
zipp==3.19.2 \
28+
--hash=sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19 \
29+
--hash=sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c
3030
# via importlib-metadata

0 commit comments

Comments
 (0)