Skip to content

Commit b870b1f

Browse files
authoredMay 21, 2023
gh-74690: Make a typing test more resilient (#104691)
1 parent 6715f91 commit b870b1f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎Lib/test/test_typing.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -3154,10 +3154,10 @@ class NonP(P):
31543154

31553155
class NonPR(PR): pass
31563156

3157-
class C:
3157+
class C(metaclass=abc.ABCMeta):
31583158
x = 1
31593159

3160-
class D:
3160+
class D(metaclass=abc.ABCMeta):
31613161
def meth(self): pass
31623162

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

31753175
acceptable_extra_attrs = {
31763176
'_is_protocol', '_is_runtime_protocol', '__parameters__',
3177-
'__subclasshook__', '__abstractmethods__', '_abc_impl',
3178-
'__init__', '__annotations__',
3177+
'__init__', '__annotations__', '__subclasshook__',
31793178
}
31803179
self.assertLessEqual(vars(NonP).keys(), vars(C).keys() | acceptable_extra_attrs)
31813180
self.assertLessEqual(

0 commit comments

Comments
 (0)