Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Commit 7d44d93

Browse files
authored
MAINT: upgrade mypy to 0.770 (the latest) (#45)
The most significant benefit is changes to `@overload` around what counts as overlapping signatures that could unlock some functionality; see e.g. - #44 (comment) - #11 (comment)
1 parent 0088d0f commit 7d44d93

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ black==18.9b0
22
flake8==3.6.0
33
flake8-pyi==18.3.1
44
pytest==4.0.0
5-
mypy==0.641
5+
mypy==0.770

tests/test_stubs.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import re
23
from collections import defaultdict
34

45
import pytest
@@ -38,8 +39,11 @@ def get_test_cases(directory):
3839
@pytest.mark.parametrize("path,py2_arg", get_test_cases(PASS_DIR))
3940
def test_success(path, py2_arg):
4041
stdout, stderr, exitcode = api.run([path] + py2_arg)
41-
assert stdout == ''
42-
assert exitcode == 0
42+
assert exitcode == 0, stdout
43+
assert re.match(
44+
r'Success: no issues found in \d+ source files?',
45+
stdout.strip(),
46+
)
4347

4448

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

5458
errors = defaultdict(lambda: "")
55-
for error_line in stdout.split("\n"):
59+
error_lines = stdout.rstrip("\n").split("\n")
60+
assert re.match(
61+
r'Found \d+ errors? in \d+ files? \(checked \d+ source files?\)',
62+
error_lines[-1].strip(),
63+
)
64+
for error_line in error_lines[:-1]:
5665
error_line = error_line.strip()
5766
if not error_line:
5867
continue

0 commit comments

Comments
 (0)