summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_typing.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 78e5892..6e2a2b1 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -2792,6 +2792,10 @@ class ForwardRefTests(BaseTestCase):
with self.assertRaises(TypeError):
issubclass(int, fr)
+ def test_forwardref_only_str_arg(self):
+ with self.assertRaises(TypeError):
+ typing.ForwardRef(1) # only `str` type is allowed
+
def test_forward_equality(self):
fr = typing.ForwardRef('int')
self.assertEqual(fr, typing.ForwardRef('int'))