summaryrefslogtreecommitdiff
path: root/pylint/test/functional/not_async_context_manager.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/test/functional/not_async_context_manager.py')
-rw-r--r--pylint/test/functional/not_async_context_manager.py71
1 files changed, 0 insertions, 71 deletions
diff --git a/pylint/test/functional/not_async_context_manager.py b/pylint/test/functional/not_async_context_manager.py
deleted file mode 100644
index 138d76dfa..000000000
--- a/pylint/test/functional/not_async_context_manager.py
+++ /dev/null
@@ -1,71 +0,0 @@
-"""Test that an async context manager receives a proper object."""
-# pylint: disable=missing-docstring, import-error, too-few-public-methods, useless-object-inheritance
-import contextlib
-
-from ala import Portocala
-
-
-@contextlib.contextmanager
-def ctx_manager():
- yield
-
-
-class ContextManager(object):
- def __enter__(self):
- pass
- def __exit__(self, *args):
- pass
-
-class PartialAsyncContextManager(object):
- def __aenter__(self):
- pass
-
-class SecondPartialAsyncContextManager(object):
- def __aexit__(self, *args):
- pass
-
-class UnknownBases(Portocala):
- def __aenter__(self):
- pass
-
-
-class AsyncManagerMixin(object):
- pass
-
-class GoodAsyncManager(object):
- def __aenter__(self):
- pass
- def __aexit__(self, *args):
- pass
-
-class InheritExit(object):
- def __aexit__(self, *args):
- pass
-
-class SecondGoodAsyncManager(InheritExit):
- def __aenter__(self):
- pass
-
-
-async def bad_coro():
- async with 42: # [not-async-context-manager]
- pass
- async with ctx_manager(): # [not-async-context-manager]
- pass
- async with ContextManager(): # [not-async-context-manager]
- pass
- async with PartialAsyncContextManager(): # [not-async-context-manager]
- pass
- async with SecondPartialAsyncContextManager(): # [not-async-context-manager]
- pass
-
-
-async def good_coro():
- async with UnknownBases():
- pass
- async with AsyncManagerMixin():
- pass
- async with GoodAsyncManager():
- pass
- async with SecondGoodAsyncManager():
- pass