Skip to content

Commit 3433a0e

Browse files
authored
Fix LSP violations in test files (#18362)
Extracted from #18356
1 parent 9463929 commit 3433a0e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

mypy/test/test_find_sources.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ class FakeFSCache(FileSystemCache):
1717
def __init__(self, files: set[str]) -> None:
1818
self.files = {os.path.abspath(f) for f in files}
1919

20-
def isfile(self, file: str) -> bool:
21-
return file in self.files
20+
def isfile(self, path: str) -> bool:
21+
return path in self.files
2222

23-
def isdir(self, dir: str) -> bool:
24-
if not dir.endswith(os.sep):
25-
dir += os.sep
26-
return any(f.startswith(dir) for f in self.files)
23+
def isdir(self, path: str) -> bool:
24+
if not path.endswith(os.sep):
25+
path += os.sep
26+
return any(f.startswith(path) for f in self.files)
2727

28-
def listdir(self, dir: str) -> list[str]:
29-
if not dir.endswith(os.sep):
30-
dir += os.sep
31-
return list({f[len(dir) :].split(os.sep)[0] for f in self.files if f.startswith(dir)})
28+
def listdir(self, path: str) -> list[str]:
29+
if not path.endswith(os.sep):
30+
path += os.sep
31+
return list({f[len(path) :].split(os.sep)[0] for f in self.files if f.startswith(path)})
3232

33-
def init_under_package_root(self, file: str) -> bool:
33+
def init_under_package_root(self, path: str) -> bool:
3434
return False
3535

3636

mypy/test/testpep561.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class PEP561Suite(DataSuite):
2323
files = ["pep561.test"]
2424
base_path = "."
2525

26-
def run_case(self, test_case: DataDrivenTestCase) -> None:
27-
test_pep561(test_case)
26+
def run_case(self, testcase: DataDrivenTestCase) -> None:
27+
test_pep561(testcase)
2828

2929

3030
@contextmanager

0 commit comments

Comments
 (0)