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.
TypeError
ForwardRef(1)
test_typing
1 parent 76b0727 commit bde3765Copy full SHA for bde3765
Lib/test/test_typing.py
@@ -2455,6 +2455,10 @@ def test_forwardref_subclass_type_error(self):
2455
with self.assertRaises(TypeError):
2456
issubclass(int, fr)
2457
2458
+ def test_forwardref_only_str_arg(self):
2459
+ with self.assertRaises(TypeError):
2460
+ typing.ForwardRef(1) # only `str` type is allowed
2461
+
2462
def test_forward_equality(self):
2463
fr = typing.ForwardRef('int')
2464
self.assertEqual(fr, typing.ForwardRef('int'))
0 commit comments