PY3.E1701
Not async context manager
Used when an async context manager is used with an object that does not implement the async context management protocol.
Noncompliant Code:
Copy
class ContextManager:
def __enter__(self):
pass
def __exit__(self, *exc):
pass
async def foo():
async with ContextManager():
pass
Compliant Code:
Copy
class AsyncContextManager:
def __aenter__(self):
pass
def __aexit__(self, *exc):
pass
async def foo():
async with AsyncContextManager():
pass