8000 bpo-38908: Fix issue when non runtime_protocol does not raise TypeError by uriyyo · Pull Request #26067 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
8000

bpo-38908: Fix issue when non runtime_protocol does not raise TypeError #26067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Lib/test/test_typing.py
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
  • Loading branch information
uriyyo and Fidget-Spinner authored May 12, 2021
commit 9c66ec36f1556833c04005156763d96a757e8c1e
7 changes: 2 additions & 5 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1426,11 +1426,8 @@ def test_non_runtime_protocol_isinstance_check(self):
class P(Protocol):
x: int

class A:
pass

with self.assertRaises(TypeError):
isinstance(A(), P)
with self.assertRaisesRegex(TypeError, "@runtime_checkable"):
isinstance(1, P)


class GenericTests(BaseTestCase):
Expand Down
0