|
26 | 26 | from collections.abc import Set, MutableSet
|
27 | 27 | from collections.abc import Mapping, MutableMapping, KeysView, ItemsView, ValuesView
|
28 | 28 | from collections.abc import Sequence, MutableSequence
|
29 |
| -from collections.abc import ByteString, Buffer |
| 29 | +from collections.abc import Buffer |
30 | 30 |
|
31 | 31 |
|
32 | 32 | class TestUserObjects(unittest.TestCase):
|
@@ -1935,28 +1935,6 @@ def assert_index_same(seq1, seq2, index_args):
|
1935 | 1935 | assert_index_same(
|
1936 | 1936 | nativeseq, seqseq, (letter, start, stop))
|
1937 | 1937 |
|
1938 |
| - def test_ByteString(self): |
1939 |
| - for sample in [bytes, bytearray]: |
1940 |
| - with self.assertWarns(DeprecationWarning): |
1941 |
| - self.assertIsInstance(sample(), ByteString) |
1942 |
| - self.assertTrue(issubclass(sample, ByteString)) |
1943 |
| - for sample in [str, list, tuple]: |
1944 |
| - with self.assertWarns(DeprecationWarning): |
1945 |
| - self.assertNotIsInstance(sample(), ByteString) |
1946 |
| - self.assertFalse(issubclass(sample, ByteString)) |
1947 |
| - with self.assertWarns(DeprecationWarning): |
1948 |
| - self.assertNotIsInstance(memoryview(b""), ByteString) |
1949 |
| - self.assertFalse(issubclass(memoryview, ByteString)) |
1950 |
| - with self.assertWarns(DeprecationWarning): |
1951 |
| - self.validate_abstract_methods(ByteString, '__getitem__', '__len__') |
1952 |
| - |
1953 |
| - with self.assertWarns(DeprecationWarning): |
1954 |
| - class X(ByteString): pass |
1955 |
| - |
1956 |
| - with self.assertWarns(DeprecationWarning): |
1957 |
| - # No metaclass conflict |
1958 |
| - class Z(ByteString, Awaitable): pass |
1959 |
| - |
1960 | 1938 | def test_Buffer(self):
|
1961 | 1939 | for sample in [bytes, bytearray, memoryview]:
|
1962 | 1940 | self.assertIsInstance(sample(b"x"), Buffer)
|
|
0 commit comments