Skip to content

Commit 16d9bc5

Browse files
committed
Skip few checks on Windows
1 parent 5825e15 commit 16d9bc5

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

mypy/test/testexportjson.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class TypeExportSuite(DataSuite):
2424
def run_case(self, testcase: DataDrivenTestCase) -> None:
2525
error = False
2626
src = "\n".join(testcase.input)
27+
is_meta = testcase.name.endswith("_meta")
2728
try:
2829
options = Options()
2930
options.use_builtins_fixtures = True
@@ -50,10 +51,10 @@ def run_case(self, testcase: DataDrivenTestCase) -> None:
5051
"__future__",
5152
"typing_extensions",
5253
"sys",
54+
"collections",
5355
):
5456
continue
5557
fnam = os.path.join(cache_dir, f"{module}.data.ff")
56-
is_meta = testcase.name.endswith("_meta")
5758
if not is_meta:
5859
with open(fnam, "rb") as f:
5960
json_data = convert_binary_cache_to_json(f.read(), implicit_names=False)
@@ -81,6 +82,15 @@ def run_case(self, testcase: DataDrivenTestCase) -> None:
8182
a = e.messages
8283
error = True
8384
if error or "\n".join(testcase.output).strip() != "<not checked>":
85+
if is_meta and sys.platform == "win32":
86+
out = filter_platform_specific(testcase.output)
87+
a = filter_platform_specific(a)
88+
else:
89+
out = testcase.output
8490
assert_string_arrays_equal(
85-
testcase.output, a, f"Invalid output ({testcase.file}, line {testcase.line})"
91+
out, a, f"Invalid output ({testcase.file}, line {testcase.line})"
8692
)
93+
94+
95+
def filter_platform_specific(lines: list[str]) -> list[str]:
96+
return [l for l in lines if '"size":' not in l and '"hash":' not in l]

0 commit comments

Comments
 (0)