Skip to content

Commit 5d9a394

Browse files
committed
add test
1 parent 71caad2 commit 5d9a394

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Lib/test/test_unittest/testmock/testmock.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,17 @@ def static_method(): pass
17431743
mock_method.assert_called_once_with()
17441744
self.assertRaises(TypeError, mock_method, 'extra_arg')
17451745

1746+
#Issue145754
1747+
def test_create_autospec_type_hints_typechecking(self):
1748+
from typing import TYPE_CHECKING
1749+
if TYPE_CHECKING:
1750+
from typing import Tuple
1751+
1752+
def foo(x: Tuple[int, ...]) -> None:
1753+
pass
1754+
1755+
mock.create_autospec(foo)
1756+
17461757
#Issue21238
17471758
def test_mock_unsafe(self):
17481759
m = Mock()

0 commit comments

Comments
 (0)