File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 55import os
66import re
77import sys
8+ import tempfile
9+ from pathlib import Path
810
911from mypy import build
1012from mypy .build import Graph
4648if sys .version_info < (3 , 13 ):
4749 typecheck_files .remove ("check-python313.test" )
4850
49- # Special tests for platforms with case-insensitive filesystems.
50- if sys .platform not in ("darwin" , "win32" ):
51- typecheck_files .remove ("check-modules-case.test" )
52-
5351
5452class TypeCheckSuite (DataSuite ):
5553 files = typecheck_files
5654
5755 def run_case (self , testcase : DataDrivenTestCase ) -> None :
56+ if os .path .basename (testcase .file ) == "check-modules-case.test" :
57+ with tempfile .NamedTemporaryFile (prefix = "test" , dir = "." ) as temp_file :
58+ temp_path = Path (temp_file .name )
59+ if not temp_path .with_name (temp_path .name .upper ()).exists ():
60+ pytest .skip ("File system is not case‐insensitive" )
5861 if lxml is None and os .path .basename (testcase .file ) == "check-reports.test" :
5962 pytest .skip ("Cannot import lxml. Is it installed?" )
6063 incremental = (
Original file line number Diff line number Diff line change 44
55import os
66import shutil
7- import sys
87import tempfile
98import unittest
109
@@ -83,7 +82,7 @@ def test_isfile_case_other_directory(self) -> None:
8382 assert self .isfile_case (os .path .join (other , "other_dir.py" ))
8483 assert not self .isfile_case (os .path .join (other , "Other_Dir.py" ))
8584 assert not self .isfile_case (os .path .join (other , "bar.py" ))
86- if sys . platform in ( "win32" , "darwin" ):
85+ if os . path . exists ( os . path . join ( other , "PKG/other_dir.py" ) ):
8786 # We only check case for directories under our prefix, and since
8887 # this path is not under the prefix, case difference is fine.
8988 assert self .isfile_case (os .path .join (other , "PKG/other_dir.py" ))
You can’t perform that action at this time.
0 commit comments