@@ -802,6 +802,8 @@ def throw(self, typ, val=None, tb=None):
802
802
def __await__ (self ):
803
803
yield
804
804
805
+ self .validate_abstract_methods (Awaitable , '__await__' )
806
+
805
807
non_samples = [None , int (), gen (), object ()]
806
808
for x in non_samples :
807
809
self .assertNotIsInstance (x , Awaitable )
@@ -852,6 +854,8 @@ def throw(self, typ, val=None, tb=None):
852
854
def __await__ (self ):
853
855
yield
854
856
857
+ self .validate_abstract_methods (Coroutine , '__await__' , 'send' , 'throw' )
858
+
855
859
non_samples = [None , int (), gen (), object (), Bar ()]
856
860
for x in non_samples :
857
861
self .assertNotIsInstance (x , Coroutine )
@@ -1935,6 +1939,7 @@ def test_ByteString(self):
1935
1939
self .assertFalse (issubclass (sample , ByteString ))
1936
1940
self .assertNotIsInstance (memoryview (b"" ), ByteString )
1937
1941
self .assertFalse (issubclass (memoryview , ByteString ))
1942
+ self .validate_abstract_methods (ByteString , '__getitem__' , '__len__' )
1938
1943
1939
1944
def test_MutableSequence (self ):
1940
1945
for sample in [tuple , str , bytes ]:
0 commit comments