Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions mypy/test/testcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import os
import re
import sys
import tempfile
from pathlib import Path

from mypy import build
from mypy.build import Graph
Expand Down Expand Up @@ -46,15 +48,16 @@
if sys.version_info < (3, 13):
typecheck_files.remove("check-python313.test")

# Special tests for platforms with case-insensitive filesystems.
if sys.platform not in ("darwin", "win32"):
typecheck_files.remove("check-modules-case.test")


class TypeCheckSuite(DataSuite):
files = typecheck_files

def run_case(self, testcase: DataDrivenTestCase) -> None:
if os.path.basename(testcase.file) == "check-modules-case.test":
with tempfile.NamedTemporaryFile(prefix="test", dir=".") as temp_file:
temp_path = Path(temp_file.name)
if not temp_path.with_name(temp_path.name.upper()).exists():
pytest.skip("File system is not case‐insensitive")
if lxml is None and os.path.basename(testcase.file) == "check-reports.test":
pytest.skip("Cannot import lxml. Is it installed?")
incremental = (
Expand Down
3 changes: 1 addition & 2 deletions mypy/test/testfscache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import os
import shutil
import sys
import tempfile
import unittest

Expand Down Expand Up @@ -83,7 +82,7 @@ def test_isfile_case_other_directory(self) -> None:
assert self.isfile_case(os.path.join(other, "other_dir.py"))
assert not self.isfile_case(os.path.join(other, "Other_Dir.py"))
assert not self.isfile_case(os.path.join(other, "bar.py"))
if sys.platform in ("win32", "darwin"):
if os.path.exists(os.path.join(other, "PKG/other_dir.py")):
# We only check case for directories under our prefix, and since
# this path is not under the prefix, case difference is fine.
assert self.isfile_case(os.path.join(other, "PKG/other_dir.py"))
Expand Down