diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2024-05-08 23:37:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-08 23:37:55 (GMT) |
commit | 2f4db5a04d6fa7ba5c1c6b82b482dd7ca48f3382 (patch) | |
tree | df37392481bc7c25e0967bda85be847abd78cf19 /Lib/test/test_collections.py | |
parent | cb6f75a32ca2649c6cc1cabb0301eb783efbd55b (diff) | |
download | cpython-2f4db5a04d6fa7ba5c1c6b82b482dd7ca48f3382.zip cpython-2f4db5a04d6fa7ba5c1c6b82b482dd7ca48f3382.tar.gz cpython-2f4db5a04d6fa7ba5c1c6b82b482dd7ca48f3382.tar.bz2 |
gh-118803: Remove `ByteString` from `typing` and `collections.abc` (#118804)
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r-- | Lib/test/test_collections.py | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 955323c..a24d3e3 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -26,7 +26,7 @@ from collections.abc import Sized, Container, Callable, Collection from collections.abc import Set, MutableSet from collections.abc import Mapping, MutableMapping, KeysView, ItemsView, ValuesView from collections.abc import Sequence, MutableSequence -from collections.abc import ByteString, Buffer +from collections.abc import Buffer class TestUserObjects(unittest.TestCase): @@ -1935,28 +1935,6 @@ class TestCollectionABCs(ABCTestCase): assert_index_same( nativeseq, seqseq, (letter, start, stop)) - def test_ByteString(self): - for sample in [bytes, bytearray]: - with self.assertWarns(DeprecationWarning): - self.assertIsInstance(sample(), ByteString) - self.assertTrue(issubclass(sample, ByteString)) - for sample in [str, list, tuple]: - with self.assertWarns(DeprecationWarning): - self.assertNotIsInstance(sample(), ByteString) - self.assertFalse(issubclass(sample, ByteString)) - with self.assertWarns(DeprecationWarning): - self.assertNotIsInstance(memoryview(b""), ByteString) - self.assertFalse(issubclass(memoryview, ByteString)) - with self.assertWarns(DeprecationWarning): - self.validate_abstract_methods(ByteString, '__getitem__', '__len__') - - with self.assertWarns(DeprecationWarning): - class X(ByteString): pass - - with self.assertWarns(DeprecationWarning): - # No metaclass conflict - class Z(ByteString, Awaitable): pass - def test_Buffer(self): for sample in [bytes, bytearray, memoryview]: self.assertIsInstance(sample(b"x"), Buffer) |