diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-07-17 19:28:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-17 19:28:56 +0200 |
commit | 7e63ebe2c3187c3b3d9e80e4a407de77002e89e5 (patch) | |
tree | 04b277b3a39542c60d201225d87f00bb22b35eaf | |
parent | 0ce5277068c2821946184f2424848e1b69baa7b4 (diff) | |
download | pylint-git-7e63ebe2c3187c3b3d9e80e4a407de77002e89e5.tar.gz |
Add regression test for Enum imported as alias (#6798)
-rw-r--r-- | doc/whatsnew/fragments/5776.false_positive | 3 | ||||
-rw-r--r-- | tests/functional/r/regression_02/regression_5776.py | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/doc/whatsnew/fragments/5776.false_positive b/doc/whatsnew/fragments/5776.false_positive new file mode 100644 index 000000000..cdc5a58af --- /dev/null +++ b/doc/whatsnew/fragments/5776.false_positive @@ -0,0 +1,3 @@ +Fixed inference of ``Enums`` when they are imported under an alias. + +Closes #5776 diff --git a/tests/functional/r/regression_02/regression_5776.py b/tests/functional/r/regression_02/regression_5776.py new file mode 100644 index 000000000..5e8342511 --- /dev/null +++ b/tests/functional/r/regression_02/regression_5776.py @@ -0,0 +1,15 @@ +"""Test for a regression with Enums not being recognized when imported with an alias. + +Reported in https://github.com/PyCQA/pylint/issues/5776 +""" + +from enum import Enum as PyEnum + + +class MyEnum(PyEnum): + """My enum""" + + ENUM_KEY = "enum_value" + + +print(MyEnum.ENUM_KEY.value) |