Skip to content

Commit aa4946d

Browse files
committed
Fix for 3.11
1 parent 70cf55f commit aa4946d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/unittest_brain.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import astroid
1919
from astroid import MANAGER, bases, builder, nodes, objects, test_utils, util
2020
from astroid.bases import Instance
21+
from astroid.const import PY311_PLUS
2122
from astroid.exceptions import (
2223
AttributeInferenceError,
2324
InferenceError,
@@ -757,7 +758,11 @@ def mymethod(self, x):
757758
# On the base Enum class 'name' and 'value' are properties
758759
# decorated by DynamicClassAttribute.
759760
prop = next(iter(one._proxied.getattr(propname)))
760-
self.assertIn("types.DynamicClassAttribute", prop.decoratornames())
761+
if PY311_PLUS:
762+
expected_name = "builtins.property"
763+
else:
764+
expected_name = "types.DynamicClassAttribute"
765+
self.assertIn(expected_name, prop.decoratornames())
761766

762767
meth = one.getattr("mymethod")[0]
763768
self.assertIsInstance(meth, astroid.FunctionDef)

0 commit comments

Comments
 (0)