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 5
5
import os
6
6
import re
7
7
import sys
8
+ import tempfile
9
+ from pathlib import Path
8
10
9
11
from mypy import build
10
12
from mypy .build import Graph
46
48
if sys .version_info < (3 , 13 ):
47
49
typecheck_files .remove ("check-python313.test" )
48
50
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
-
53
51
54
52
class TypeCheckSuite (DataSuite ):
55
53
files = typecheck_files
56
54
57
55
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" )
58
61
if lxml is None and os .path .basename (testcase .file ) == "check-reports.test" :
59
62
pytest .skip ("Cannot import lxml. Is it installed?" )
60
63
incremental = (
Original file line number Diff line number Diff line change 4
4
5
5
import os
6
6
import shutil
7
- import sys
8
7
import tempfile
9
8
import unittest
10
9
@@ -83,7 +82,7 @@ def test_isfile_case_other_directory(self) -> None:
83
82
assert self .isfile_case (os .path .join (other , "other_dir.py" ))
84
83
assert not self .isfile_case (os .path .join (other , "Other_Dir.py" ))
85
84
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" ) ):
87
86
# We only check case for directories under our prefix, and since
88
87
# this path is not under the prefix, case difference is fine.
89
88
assert self .isfile_case (os .path .join (other , "PKG/other_dir.py" ))
You can’t perform that action at this time.
0 commit comments