Skip to content

Commit a83ca8f

Browse files
committed
Improve quality of test for cached annotate function
1 parent c4d8d9d commit a83ca8f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_annotationlib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ def test_callable_cache_annotate_forwardref_value_fallback(self):
16551655
def format(format, /, __Format=Format,
16561656
__NotImplementedError=NotImplementedError):
16571657
if format == __Format.VALUE:
1658-
return {"x": random.random()}
1658+
return {"x": random.random(), "y": str}
16591659
else:
16601660
raise __NotImplementedError(format)
16611661

@@ -1667,6 +1667,7 @@ def format(format, /, __Format=Format,
16671667
self.assertIsInstance(annotations, dict)
16681668
self.assertIn("x", annotations)
16691669
self.assertIsInstance(annotations["x"], float)
1670+
self.assertIs(annotations["y"], str)
16701671

16711672
new_anns = annotationlib.call_annotate_function(format, Format.FORWARDREF)
16721673
self.assertEqual(annotations, new_anns)

0 commit comments

Comments
 (0)