summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_typing.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r--Lib/test/test_typing.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 9f9e3eb..fc89380 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -4554,6 +4554,15 @@ class ProtocolTests(BaseTestCase):
)
self.assertIs(type(exc.__cause__), CustomError)
+ def test_deferred_evaluation_of_annotations(self):
+ class DeferredProto(Protocol):
+ x: DoesNotExist
+ self.assertEqual(get_protocol_members(DeferredProto), {"x"})
+ self.assertEqual(
+ annotationlib.get_annotations(DeferredProto, format=annotationlib.Format.STRING),
+ {'x': 'DoesNotExist'}
+ )
+
class GenericTests(BaseTestCase):