Skip to content

Commit 2326eed

Browse files
committed
tests: type check
1 parent 63130e3 commit 2326eed

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

tests/test_find_names.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ def check_find_names(
2323
if not confirm:
2424
return
2525

26+
exec_locals: object
2627
exec_locals = {}
2728
actually_undefined = undefined - set(dir(__import__("builtins")))
2829
if actually_undefined:
2930
# If something is actually undefined, we should raise a NameError when we execute
3031
# (if we hit another exception first, we fix the test!)
3132
with pytest.raises(NameError) as e:
3233
exec(code, exec_locals)
33-
undefined_var = re.search(r"(name|variable) '(\w+)'", e.value.args[0]).group(2)
34+
m = re.search(r"(name|variable) '(\w+)'", e.value.args[0])
35+
assert m is not None
36+
undefined_var = m.group(2)
3437
assert undefined_var in actually_undefined
3538
else:
3639
try:

tests/test_pyp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def delete_config_env_var(monkeypatch):
2424
monkeypatch.delenv("PYP_CONFIG_PATH", raising=False)
2525

2626

27-
def run_cmd(cmd: str, input: Optional[str] = None, check: bool = True) -> str:
27+
def run_cmd(cmd: str, input: Union[str, bytes, None] = None, check: bool = True) -> str:
2828
if isinstance(input, str):
2929
input = input.encode("utf-8")
3030
proc = subprocess.run(

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ deps = mypy>=1.13
2424
commands =
2525
mypy --strict -m pyp --python-version 3.8
2626
mypy --strict -m pyp --python-version 3.13
27+
mypy . --python-version 3.13
2728

2829
[coverage:report]
2930
exclude_lines =

0 commit comments

Comments
 (0)