diff options
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): |