diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 62762418b3f4a8..2842e28c5ab598 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -2650,6 +2650,10 @@ def test_forwardref_subclass_type_error(self): 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'))