We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d19d8d5 commit c206f0dCopy full SHA for c206f0d
Lib/test/test_opcodes.py
@@ -42,14 +42,13 @@ def test_use_existing_annotations(self):
42
self.assertEqual(ns['__annotations__'], {'x': int, 1: 2})
43
44
def test_do_not_recreate_annotations(self):
45
- annotations = {}
46
# Don't rely on the existence of the '__annotations__' global.
47
- with support.swap_item(globals(), '__annotations__', annotations):
+ with support.swap_item(globals(), '__annotations__', {}):
+ del globals()['__annotations__']
48
class C:
49
del __annotations__
50
- x: int # Updates the '__annotations__' global.
51
- self.assertIn('x', annotations)
52
- self.assertIs(annotations['x'], int)
+ with self.assertRaises(NameError):
+ x: int
53
54
def test_raise_class_exceptions(self):
55
0 commit comments