Skip to content

Commit 15e2003

Browse files
committed
Modify astroid.bases and tests.test_nodes to reflect that enum.property was added in Python 3.11, not 3.10
1 parent d91c778 commit 15e2003

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

ChangeLog

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Release date: TBA
3636

3737
Closes #10377
3838

39+
* Modify ``astroid.bases`` and ``tests.test_nodes`` to reflect that `enum.property` was added in Python 3.11, not 3.10
40+
3941
What's New in astroid 3.3.11?
4042
=============================
4143
Release date: TBA

astroid/bases.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from typing import TYPE_CHECKING, Any, Literal
1414

1515
from astroid import decorators, nodes
16-
from astroid.const import PY310_PLUS
16+
from astroid.const import PY311_PLUS
1717
from astroid.context import (
1818
CallContext,
1919
InferenceContext,
@@ -39,7 +39,8 @@
3939

4040

4141
PROPERTIES = {"builtins.property", "abc.abstractproperty", "functools.cached_property"}
42-
if PY310_PLUS:
42+
# enum.property was added in Python 3.11
43+
if PY311_PLUS:
4344
PROPERTIES.add("enum.property")
4445

4546
# List of possible property names. We use this list in order

tests/test_nodes.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
transforms,
2929
util,
3030
)
31-
from astroid.const import IS_PYPY, PY310_PLUS, PY312_PLUS, Context
31+
from astroid.const import IS_PYPY, PY310_PLUS, PY311_PLUS, PY312_PLUS, Context
3232
from astroid.context import InferenceContext
3333
from astroid.exceptions import (
3434
AstroidBuildingError,
@@ -966,8 +966,8 @@ def functools_property(self): return 42
966966
):
967967
self._is_property(ast, prop)
968968

969-
@pytest.mark.skipif(not PY310_PLUS, reason="Uses enum.property")
970-
def test_is_standard_property_py310(self) -> None:
969+
@pytest.mark.skipif(not PY311_PLUS, reason="Uses enum.property")
970+
def test_is_standard_property_py311(self) -> None:
971971
# Test to make sure the Python-provided property decorators
972972
# are properly interpreted as properties
973973
ast = builder.parse(
@@ -1102,8 +1102,8 @@ def annotated_user_functools_property(self): return 42
11021102
):
11031103
self._is_property(ast, prop)
11041104

1105-
@pytest.mark.skipif(not PY310_PLUS, reason="Uses enum.property")
1106-
def test_is_standard_property_subclass_py310(self) -> None:
1105+
@pytest.mark.skipif(not PY311_PLUS, reason="Uses enum.property")
1106+
def test_is_standard_property_subclass_py311(self) -> None:
11071107
# Test to make sure that subclasses of the Python-provided property decorators
11081108
# are properly interpreted as properties
11091109
ast = builder.parse(

0 commit comments

Comments
 (0)