Skip to content

Commit 85f8a70

Browse files
fix: satisfy mypy 2.3.0 [deprecated] and [unreachable] checks
- tox_run.py: os.system is soft-deprecated, use subprocess.call - test_monkeypatch.py: inspect.isclass is now typed as TypeIs[type], narrowing makes the post-context assert look unreachable
1 parent b0ec52b commit 85f8a70

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

testing/freeze/tox_run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
if __name__ == "__main__":
1010
import os
11+
import subprocess
1112
import sys
1213

1314
executable = os.path.join(os.getcwd(), "dist", "runtests_script", "runtests_script")
1415
if sys.platform.startswith("win"):
1516
executable += ".exe"
16-
sys.exit(os.system(f"{executable} tests"))
17+
sys.exit(subprocess.call([executable, "tests"]))

testing/test_monkeypatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def test_context() -> None:
436436
with monkeypatch.context() as m:
437437
m.setattr(functools, "partial", 3)
438438
assert not inspect.isclass(functools.partial)
439-
assert inspect.isclass(functools.partial)
439+
assert inspect.isclass(functools.partial) # type: ignore[unreachable]
440440

441441

442442
def test_context_classmethod() -> None:

0 commit comments

Comments
 (0)