@@ -1940,14 +1940,25 @@ def assert_index_same(seq1, seq2, index_args):
1940
1940
1941
1941
def test_ByteString (self ):
1942
1942
for sample in [bytes , bytearray ]:
1943
- self .assertIsInstance (sample (), ByteString )
1943
+ with self .assertWarns (DeprecationWarning ):
1944
+ self .assertIsInstance (sample (), ByteString )
1944
1945
self .assertTrue (issubclass (sample , ByteString ))
1945
1946
for sample in [str , list , tuple ]:
1946
- self .assertNotIsInstance (sample (), ByteString )
1947
+ with self .assertWarns (DeprecationWarning ):
1948
+ self .assertNotIsInstance (sample (), ByteString )
1947
1949
self .assertFalse (issubclass (sample , ByteString ))
1948
- self .assertNotIsInstance (memoryview (b"" ), ByteString )
1950
+ with self .assertWarns (DeprecationWarning ):
1951
+ self .assertNotIsInstance (memoryview (b"" ), ByteString )
1949
1952
self .assertFalse (issubclass (memoryview , ByteString ))
1950
- self .validate_abstract_methods (ByteString , '__getitem__' , '__len__' )
1953
+ with self .assertWarns (DeprecationWarning ):
1954
+ self .validate_abstract_methods (ByteString , '__getitem__' , '__len__' )
1955
+
1956
+ with self .assertWarns (DeprecationWarning ):
1957
+ class X (ByteString ): pass
1958
+
1959
+ with self .assertWarns (DeprecationWarning ):
1960
+ # No metaclass conflict
1961
+ class Z (ByteString , Awaitable ): pass
1951
1962
1952
1963
def test_Buffer (self ):
1953
1964
for sample in [bytes , bytearray , memoryview ]:
0 commit comments