diff options
author | Yurii Karabas <1998uriyyo@gmail.com> | 2021-05-12 15:47:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 15:47:49 (GMT) |
commit | c40486a32d7e37b01ead94e701d69847f5b60e30 (patch) | |
tree | ca42f8aad68e8e6bfb324017b8a79f8207de4c5d /Lib/test/test_typing.py | |
parent | 9b06e4b535a3a0af495604778d4010a4677478cc (diff) | |
download | cpython-c40486a32d7e37b01ead94e701d69847f5b60e30.zip cpython-c40486a32d7e37b01ead94e701d69847f5b60e30.tar.gz cpython-c40486a32d7e37b01ead94e701d69847f5b60e30.tar.bz2 |
bpo-38908: Fix issue when non runtime_protocol failed to raise TypeError (#26067)
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): |