Skip to content

Commit

Permalink
Fix Enum.__member__ regression tests
Browse files Browse the repository at this point in the history
Ref pylint-dev/astroid#940. These tests failed after fixing inference of
Enum.__members__ due to unexpected "not-iterable" warnings raised. These
warnings were not false-positives, as the test definition would have
raised TypeError at runtime: .keys and .values on dict/mappingproxy
are not properties, but methods.
  • Loading branch information
nelfin committed May 10, 2021
1 parent 3fc4052 commit 9c8d5fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/functional/m/member/member_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class Animal(Enum):
# To test false positive no-member on Enum.__members__.items()
for itm in Animal.__members__.items():
print(itm)
for keyy in Animal.__members__.keys:
for keyy in Animal.__members__.keys(): # pylint: disable=consider-iterating-dictionary
print(keyy)
for vall in Animal.__members__.values:
for vall in Animal.__members__.values():
print(vall)

0 comments on commit 9c8d5fc

Please sign in to comment.