Skip to content

Commit

Permalink
Add regression test for asserting distinct callable types (#15258)
Browse files Browse the repository at this point in the history
Closes #15153.

This issue was already addressed in #15184; we're adding a regression
test.
  • Loading branch information
ikonst authored May 18, 2023
1 parent af39755 commit 863cabb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test-data/unit/check-assert-type-fail.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ class array:
def f(si: arr.array[int]):
typing.assert_type(si, int) # E: Expression is of type "array[int]", not "int"
[builtins fixtures/tuple.pyi]

[case testAssertTypeFailCallableArgKind]
from typing import assert_type, Callable
def myfunc(arg: int) -> None: pass
assert_type(myfunc, Callable[[int], None]) # E: Expression is of type "Callable[[Arg(int, 'arg')], None]", not "Callable[[int], None]"

0 comments on commit 863cabb

Please sign in to comment.