Skip to content

Commit e076b5c

Browse files
Conformance tests: Fix automated checking on overloads_basic.py (#1687)
1 parent 392353c commit e076b5c

File tree

5 files changed

+11
-21
lines changed

5 files changed

+11
-21
lines changed

conformance/results/mypy/overloads_basic.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ overloads_basic.py:37: note: def __getitem__(self, slice, /) -> bytes
77
overloads_basic.py:62: error: Single overload definition, multiple required [misc]
88
overloads_basic.py:74: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
99
"""
10-
conformance_automated = "Fail"
10+
conformance_automated = "Pass"
1111
errors_diff = """
12-
Line 64: Expected 1 errors
13-
Line 76: Expected 1 errors
14-
Line 62: Unexpected errors ['overloads_basic.py:62: error: Single overload definition, multiple required [misc]']
15-
Line 74: Unexpected errors ['overloads_basic.py:74: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]']
1612
"""

conformance/results/pyre/overloads_basic.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ overloads_basic.py:75:0 Missing overload implementation [42]: Overloaded functio
88
"""
99
conformance_automated = "Fail"
1010
errors_diff = """
11-
Line 64: Expected 1 errors
12-
Line 76: Expected 1 errors
13-
Line 75: Unexpected errors ['overloads_basic.py:75:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation.']
11+
Lines 62, 63: Expected error (tag 'func1')
1412
"""

conformance/results/pyright/overloads_basic.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assign
66
overloads_basic.py:63:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload)
77
overloads_basic.py:75:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation)
88
"""
9-
conformance_automated = "Fail"
9+
conformance_automated = "Pass"
1010
errors_diff = """
11-
Line 64: Expected 1 errors
12-
Line 76: Expected 1 errors
13-
Line 63: Unexpected errors ['overloads_basic.py:63:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload)']
14-
Line 75: Unexpected errors ['overloads_basic.py:75:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation)']
1511
"""

conformance/results/pytype/overloads_basic.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ File "overloads_basic.py", line 58, in map: bad return type [bad-return-type]
1010
"""
1111
conformance_automated = "Fail"
1212
errors_diff = """
13-
Line 64: Expected 1 errors
14-
Line 76: Expected 1 errors
13+
Lines 62, 63: Expected error (tag 'func1')
14+
Lines 74, 75: Expected error (tag 'func2')
1515
Line 31: Unexpected errors ['File "overloads_basic.py", line 31, in __getitem__: bad return type [bad-return-type]']
1616
Line 58: Unexpected errors ['File "overloads_basic.py", line 58, in map: bad return type [bad-return-type]']
1717
"""

conformance/tests/overloads_basic.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def map(func: Any, iter1: Any, iter2: Any = ...) -> Any:
5959

6060

6161
# At least two overload signatures should be provided.
62-
@overload
63-
def func1() -> None:
64-
... # E: At least two overloads must be present
62+
@overload # E[func1]
63+
def func1() -> None: # E[func1]: At least two overloads must be present
64+
...
6565

6666

6767
def func1() -> None:
@@ -71,9 +71,9 @@ def func1() -> None:
7171
# > In regular modules, a series of @overload-decorated definitions must be
7272
# > followed by exactly one non-@overload-decorated definition (for the same
7373
# > function/method).
74-
@overload
75-
def func2(x: int) -> int:
76-
... # E: no implementation
74+
@overload # E[func2]
75+
def func2(x: int) -> int: # E[func2]: no implementation
76+
...
7777

7878

7979
@overload

0 commit comments

Comments
 (0)