Skip to content

Commit 569deb2

Browse files
Apply suggestions from code review
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent 5d9a394 commit 569deb2

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

Lib/test/test_unittest/testmock/testmock.py

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

1746-
#Issue145754
1746+
# gh-145754
17471747
def test_create_autospec_type_hints_typechecking(self):
1748-
from typing import TYPE_CHECKING
1749-
if TYPE_CHECKING:
1750-
from typing import Tuple
17511748

17521749
def foo(x: Tuple[int, ...]) -> None:
17531750
pass
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Request signature during mock autospec with ``FORWARDREF`` annotation format.
2-
This prevents runtime errors when a type referred in a type hint is
3-
imported within a ``TYPE_CHECKING`` block.
2+
This prevents runtime errors when an annotation uses a name that is not defined at runtime.

0 commit comments

Comments
 (0)