Skip to content

Commit 1adb0c1

Browse files
committed
Extract SKIP_PACKAGES
1 parent fba5573 commit 1adb0c1

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/run_stubtest.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
root = Path(__file__).parent.parent
1212
stubs_path = root / "stubs"
1313
PARTIAL_STUBS_MARKER = "-stubs"
14+
SKIP_PACKAGES = {
15+
# This stub has been upstreamed and is only kept for backwards compatibility
16+
# The version that is stubbed does not match the one we install for type testing
17+
"matplotlib",
18+
}
1419

1520

1621
def run_stubtest(module: str) -> CompletedProcess[bytes]:
@@ -40,16 +45,12 @@ def run_stubtest(module: str) -> CompletedProcess[bytes]:
4045
return run((sys.executable, "-m", *args), cwd=stubs_path)
4146

4247

43-
def main(modules: Collection[str]) -> int:
48+
def main(packages: Collection[str]) -> int:
4449
returncode = 0
45-
if not modules:
46-
modules = os.listdir(stubs_path)
47-
for stub_module in modules:
48-
if stub_module in {
49-
# This stub has been upstreamed and is only kept for backwards compatibility
50-
# The version that is stubbed does not match the one we install for type testing
51-
"matplotlib",
52-
}:
50+
if not packages:
51+
packages = os.listdir(stubs_path)
52+
for stub_module in packages:
53+
if stub_module in SKIP_PACKAGES:
5354
print(f"\nSkipped {stub_module}", flush=True)
5455
continue
5556
if stub_module.startswith("."):

0 commit comments

Comments
 (0)