mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
gh-91896: Revert some very noisy DeprecationWarnings for ByteString
(#104424)
This commit is contained in:
parent
1be80ed107
commit
c527eb1c2a
7 changed files with 19 additions and 79 deletions
|
@ -11,7 +11,6 @@ from itertools import product, chain, combinations
|
|||
import string
|
||||
import sys
|
||||
from test import support
|
||||
from test.support.import_helper import import_fresh_module
|
||||
import types
|
||||
import unittest
|
||||
|
||||
|
@ -26,7 +25,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 Buffer
|
||||
from collections.abc import ByteString, Buffer
|
||||
|
||||
|
||||
class TestUserObjects(unittest.TestCase):
|
||||
|
@ -1940,8 +1939,6 @@ class TestCollectionABCs(ABCTestCase):
|
|||
nativeseq, seqseq, (letter, start, stop))
|
||||
|
||||
def test_ByteString(self):
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
from collections.abc import ByteString
|
||||
for sample in [bytes, bytearray]:
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
self.assertIsInstance(sample(), ByteString)
|
||||
|
@ -1963,11 +1960,6 @@ class TestCollectionABCs(ABCTestCase):
|
|||
# No metaclass conflict
|
||||
class Z(ByteString, Awaitable): pass
|
||||
|
||||
def test_ByteString_attribute_access(self):
|
||||
collections_abc = import_fresh_module("collections.abc")
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
collections_abc.ByteString
|
||||
|
||||
def test_Buffer(self):
|
||||
for sample in [bytes, bytearray, memoryview]:
|
||||
self.assertIsInstance(sample(b"x"), Buffer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue