Skip to content

Commit e3f5fb5

Browse files
authored
Restore tests for ByteString in 3.14 (#2829)
1 parent 97f4837 commit e3f5fb5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

astroid/brain/brain_typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class {0}(metaclass=Meta):
7878
"typing.MutableMapping",
7979
"typing.Sequence",
8080
"typing.MutableSequence",
81-
"typing.ByteString", # removed in 3.14
81+
"typing.ByteString", # scheduled for removal in 3.17
8282
"typing.Tuple",
8383
"typing.List",
8484
"typing.Deque",

tests/brain/test_brain.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from astroid import MANAGER, builder, nodes, objects, test_utils, util
1616
from astroid.bases import Instance
1717
from astroid.brain.brain_namedtuple_enum import _get_namedtuple_fields
18-
from astroid.const import PY312_PLUS, PY313_PLUS, PY314_PLUS
18+
from astroid.const import PY312_PLUS, PY313_PLUS
1919
from astroid.exceptions import (
2020
AttributeInferenceError,
2121
InferenceError,
@@ -181,7 +181,7 @@ def check_metaclass_is_abc(node: nodes.ClassDef):
181181
if PY312_PLUS and node.name == "ByteString":
182182
# .metaclass() finds the first metaclass in the mro(),
183183
# which, from 3.12, is _DeprecateByteStringMeta (unhelpful)
184-
# until ByteString is removed in 3.14.
184+
# until ByteString is removed in 3.17.
185185
# Jump over the first two ByteString classes in the mro().
186186
check_metaclass_is_abc(node.mro()[2])
187187
else:
@@ -285,9 +285,6 @@ class Derived(collections.abc.Iterator[int]):
285285
],
286286
)
287287

288-
@pytest.mark.skipif(
289-
PY314_PLUS, reason="collections.abc.ByteString was removed in 3.14"
290-
)
291288
def test_collections_object_subscriptable_3(self):
292289
"""With Python 3.9 the ByteString class of the collections module is subscriptable
293290
(but not the same class from typing module)"""
@@ -870,9 +867,8 @@ class Derived(typing.Hashable, typing.Iterator[int]):
870867
],
871868
)
872869

873-
@pytest.mark.skipif(PY314_PLUS, reason="typing.ByteString was removed in 3.14")
874870
def test_typing_object_notsubscriptable_3(self):
875-
"""Until python39 ByteString class of the typing module is not
871+
"""The ByteString class of the typing module is not
876872
subscriptable (whereas it is in the collections' module)"""
877873
right_node = builder.extract_node(
878874
"""

0 commit comments

Comments
 (0)