diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2022-08-20 17:04:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-20 17:04:11 +0200 |
commit | 2e2f20890097c59f2d4408b8adf27f1203c67412 (patch) | |
tree | b6fbb7a65cca9a67c7b5da4836cb6957a4f57ce6 | |
parent | 118834095d1376e2364cb7b1439040ecd5e03a7d (diff) | |
download | pylint-git-2e2f20890097c59f2d4408b8adf27f1203c67412.tar.gz |
Add enum regression test (#7323)
-rw-r--r-- | tests/functional/r/regression_02/regression_enum_1734.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/functional/r/regression_02/regression_enum_1734.py b/tests/functional/r/regression_02/regression_enum_1734.py new file mode 100644 index 000000000..06759c7d3 --- /dev/null +++ b/tests/functional/r/regression_02/regression_enum_1734.py @@ -0,0 +1,24 @@ +# Regression test for https://github.com/PyCQA/astroid/pull/1734 +# The following should lint just fine +# Fixed in https://github.com/PyCQA/astroid/pull/1743 + +# pylint: disable=missing-docstring,invalid-name + +from enum import Enum + +class Test(Enum): + LOADED = "loaded", True + SETUP_ERROR = "setup_error", True + + _recoverable: bool + + def __new__(cls, value: str, recoverable: bool): + obj = object.__new__(cls) + obj._value_ = value + obj._recoverable = recoverable + return obj + + @property + def recoverable(self) -> bool: + """Get if the state is recoverable.""" + return self._recoverable |