@@ -810,6 +810,8 @@ def throw(self, typ, val=None, tb=None):
810
810
def __await__ (self ):
811
811
yield
812
812
813
+ self .validate_abstract_methods (Awaitable , '__await__' )
814
+
813
815
non_samples = [None , int (), gen (), object ()]
814
816
for x in non_samples :
815
817
self .assertNotIsInstance (x , Awaitable )
@@ -860,6 +862,8 @@ def throw(self, typ, val=None, tb=None):
860
862
def __await__ (self ):
861
863
yield
862
864
865
+ self .validate_abstract_methods (Coroutine , '__await__' , 'send' , 'throw' )
866
+
863
867
non_samples = [None , int (), gen (), object (), Bar ()]
864
868
for x in non_samples :
865
869
self .assertNotIsInstance (x , Coroutine )
@@ -1943,6 +1947,7 @@ def test_ByteString(self):
1943
1947
self .assertFalse (issubclass (sample , ByteString ))
1944
1948
self .assertNotIsInstance (memoryview (b"" ), ByteString )
1945
1949
self .assertFalse (issubclass (memoryview , ByteString ))
1950
+ self .validate_abstract_methods (ByteString , '__getitem__' , '__len__' )
1946
1951
1947
1952
def test_MutableSequence (self ):
1948
1953
for sample in [tuple , str , bytes ]:
0 commit comments