Skip to content
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
Explicitly clear the cache
  • Loading branch information
AlexWaygood committed May 31, 2023
commit 0b13ae02ac75e3d3cacebd6176c3bd194517b366
6 changes: 6 additions & 0 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3706,6 +3706,9 @@ def __init__(self):
Foo() # Previously triggered RecursionError

def test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta(self):
Comment thread
JelleZijlstra marked this conversation as resolved.
# Ensure the cache is empty, or this test won't work correctly
collections.abc.Sized._abc_registry_clear()

class Foo(collections.abc.Sized, Protocol): pass

# gh-105144: this previously raised TypeError
Expand All @@ -3714,6 +3717,9 @@ class Foo(collections.abc.Sized, Protocol): pass
self.assertNotIsInstance(1, collections.abc.Sized)

def test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta_2(self):
# Ensure the cache is empty, or this test won't work correctly
collections.abc.Sized._abc_registry_clear()

class Foo(typing.Sized, Protocol): pass

# gh-105144: this previously raised TypeError
Expand Down