Skip to content

Commit

Permalink
gh-74690: Make a typing test more resilient (#104691)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored May 21, 2023
1 parent 6715f91 commit b870b1f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3154,10 +3154,10 @@ class NonP(P):

class NonPR(PR): pass

class C:
class C(metaclass=abc.ABCMeta):
x = 1

class D:
class D(metaclass=abc.ABCMeta):
def meth(self): pass

self.assertNotIsInstance(C(), NonP)
Expand All @@ -3174,8 +3174,7 @@ def meth(self): pass

acceptable_extra_attrs = {
'_is_protocol', '_is_runtime_protocol', '__parameters__',
'__subclasshook__', '__abstractmethods__', '_abc_impl',
'__init__', '__annotations__',
'__init__', '__annotations__', '__subclasshook__',
}
self.assertLessEqual(vars(NonP).keys(), vars(C).keys() | acceptable_extra_attrs)
self.assertLessEqual(
Expand Down

0 comments on commit b870b1f

Please sign in to comment.