diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2023-05-21 00:13:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-21 00:13:37 (GMT) |
commit | b870b1fa755808977578e99bd42859c519e00bb7 (patch) | |
tree | 17dc5219f9fe61a30aac32bc9a8c4e63cf9dc740 | |
parent | 6715f91edcf6f379f666e18f57b8a0dcb724bf79 (diff) | |
download | cpython-b870b1fa755808977578e99bd42859c519e00bb7.zip cpython-b870b1fa755808977578e99bd42859c519e00bb7.tar.gz cpython-b870b1fa755808977578e99bd42859c519e00bb7.tar.bz2 |
gh-74690: Make a typing test more resilient (#104691)
-rw-r--r-- | Lib/test/test_typing.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 6459fa3..9a3e642 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3154,10 +3154,10 @@ class ProtocolTests(BaseTestCase): 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) @@ -3174,8 +3174,7 @@ class ProtocolTests(BaseTestCase): 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( |