forked from pylint-dev/pylint
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a regression tests for issue pylint-dev#2567
- Loading branch information
1 parent
361a1f7
commit e0a4a6e
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
""" | ||
Regression test for `no-member`. | ||
See: https://github.com/PyCQA/pylint/issues/2567 | ||
""" | ||
|
||
# pylint: disable=missing-docstring,too-few-public-methods | ||
|
||
import contextlib | ||
|
||
|
||
@contextlib.contextmanager | ||
def context_manager(): | ||
try: | ||
yield | ||
finally: | ||
pass | ||
|
||
|
||
cm = context_manager() | ||
cm.__enter__() | ||
cm.__exit__(None, None, None) | ||
|
||
|
||
@contextlib.contextmanager | ||
def other_context_manager(): | ||
try: | ||
yield | ||
finally: | ||
pass | ||
|
||
|
||
with other_context_manager(): # notice the function call | ||
pass |