Skip to content

Commit

Permalink
MAINT: upgrade mypy to 0.770 (the latest) (numpy#45)
Browse files Browse the repository at this point in the history
The most significant benefit is changes to `@overload` around what
counts as overlapping signatures that could unlock some functionality;
see e.g.

- numpy#44 (comment)
- numpy#11 (comment)
  • Loading branch information
person142 authored Mar 29, 2020
1 parent 0088d0f commit 7d44d93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ black==18.9b0
flake8==3.6.0
flake8-pyi==18.3.1
pytest==4.0.0
mypy==0.641
mypy==0.770
15 changes: 12 additions & 3 deletions tests/test_stubs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
from collections import defaultdict

import pytest
Expand Down Expand Up @@ -38,8 +39,11 @@ def get_test_cases(directory):
@pytest.mark.parametrize("path,py2_arg", get_test_cases(PASS_DIR))
def test_success(path, py2_arg):
stdout, stderr, exitcode = api.run([path] + py2_arg)
assert stdout == ''
assert exitcode == 0
assert exitcode == 0, stdout
assert re.match(
r'Success: no issues found in \d+ source files?',
stdout.strip(),
)


@pytest.mark.parametrize("path,py2_arg", get_test_cases(FAIL_DIR))
Expand All @@ -52,7 +56,12 @@ def test_fail(path, py2_arg):
lines = fin.readlines()

errors = defaultdict(lambda: "")
for error_line in stdout.split("\n"):
error_lines = stdout.rstrip("\n").split("\n")
assert re.match(
r'Found \d+ errors? in \d+ files? \(checked \d+ source files?\)',
error_lines[-1].strip(),
)
for error_line in error_lines[:-1]:
error_line = error_line.strip()
if not error_line:
continue
Expand Down

0 comments on commit 7d44d93

Please sign in to comment.