diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-05-12 16:09:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 16:09:04 (GMT) |
commit | a2d94a0a9b8ae95d7d2b7fc34b501da5242ec22c (patch) | |
tree | d69473e07ab467afb932ef0c7fd0fea8dbf7e0c2 /Lib/test/test_typing.py | |
parent | bd5dfd6c8c133ccda4dddcba3a8c5a9ea1aa1d6b (diff) | |
download | cpython-a2d94a0a9b8ae95d7d2b7fc34b501da5242ec22c.zip cpython-a2d94a0a9b8ae95d7d2b7fc34b501da5242ec22c.tar.gz cpython-a2d94a0a9b8ae95d7d2b7fc34b501da5242ec22c.tar.bz2 |
bpo-38908: Fix issue when non runtime_protocol failed to raise TypeError (GH-26067)
(cherry picked from commit c40486a32d7e37b01ead94e701d69847f5b60e30)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 47dc0b9..a2a5d8f 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -1422,6 +1422,14 @@ class ProtocolTests(BaseTestCase): class CustomContextManager(typing.ContextManager, Protocol): pass + def test_non_runtime_protocol_isinstance_check(self): + class P(Protocol): + x: int + + with self.assertRaisesRegex(TypeError, "@runtime_checkable"): + isinstance(1, P) + + class GenericTests(BaseTestCase): def test_basics(self): |