mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
bpo-46685: cover TypeError of ForwardRef(1) in test_typing (GH-31223)
(cherry picked from commit d2d1d49eac)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
c2735b75af
commit
d29bbc22b0
1 changed files with 4 additions and 0 deletions
|
|
@ -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'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue