You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- case: break_followingmain: | from typing import overload, TypeVar T = TypeVar("T", int, str) @overload def f(x: int) -> int: ... @overload def f(x: str) -> str: ... def f(x: T) -> T: return x reveal_type(f([1, 2, 3])) # N: Revealed type is "Any"
will get message as follows:
E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output:
E Expected:
E <45 (diff)
E Actual:
E main:12: error: No overload variant of "f" matches argument type "List[int]" (diff)
E main:12: note: def f(x: int) -> int (diff)
E main:12: note: def f(x: str) -> str (diff)
E main:12: note: Possible overload variants: (diff)
E main:12: note: Revealed type is "Any" (diff)
E
E Alignment of first line difference:
E E: main:12: note: Revealed type is "Any"...
E A: main:12: error: No overload variant of "f" matches argument type "List[i...
E
while mypy will return
main.py:13: error: No overload variant of "f" matches argument type "List[int]"
main.py:13: note: Possible overload variants:
main.py:13: note: def f(x: int) -> int
main.py:13: note: def f(x: str) -> str
main.py:13: note: Revealed type is "Any"
Please note that
E main:14: note: Possible overload variants: (diff)
is misplaced compared to mypy output.
It happens, because sorting key includes actual error message:
Currently, sorted_by_file_and_line uses `(filename, line, content)`.
This means it is not stable within `(filename, line)` and can
incorrectly reorder multiline outputs
Closestypeddjango#66
Currently, sorted_by_file_and_line uses `(filename, line, content)`.
This means it is not stable within `(filename, line)` and can
incorrectly reorder multiline outputs
Closes#66
Given following test case
will get message as follows:
while mypy will return
Please note that
is misplaced compared to
mypy
output.It happens, because sorting key includes actual error message:
pytest-mypy-plugins/pytest_mypy_plugins/utils.py
Line 209 in f7b249d
so sort is not stable within (
fname
,line_number
).Environment:
The text was updated successfully, but these errors were encountered: