Skip to content

Commit 8296cd8

Browse files
committed
actual function is only called once
1 parent 4d88779 commit 8296cd8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Lib/test/test_annotationlib.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,10 +1254,9 @@ def test_user_annotate_forwardref(self):
12541254
Format.FORWARDREF,
12551255
)
12561256

1257-
annotate.assert_has_calls([
1258-
unittest.mock.call(Format.FORWARDREF),
1259-
unittest.mock.call(Format.VALUE_WITH_FAKE_GLOBALS),
1260-
])
1257+
# The annotate function itself is not called the second time
1258+
# A new function built from the code is called instead
1259+
annotate.assert_called_once_with(Format.FORWARDREF)
12611260

12621261
def test_user_annotate_string(self):
12631262
annotate = self._annotate_mock()
@@ -1274,7 +1273,6 @@ def test_user_annotate_string(self):
12741273
])
12751274

12761275

1277-
12781276
class MetaclassTests(unittest.TestCase):
12791277
def test_annotated_meta(self):
12801278
class Meta(type):

0 commit comments

Comments
 (0)