.. _async-context-manager-with-regular-with: async-context-manager-with-regular-with / E1145 =============================================== **Message emitted:** ``Context manager '%s' is async and should be used with 'async with'.`` **Description:** *Used when an async context manager is used with a regular 'with' statement instead of 'async with'.* **Problematic code:** .. literalinclude:: /data/messages/a/async-context-manager-with-regular-with/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/a/async-context-manager-with-regular-with/good.py :language: python **Related links:** - `PEP 492 - Coroutines with async and await syntax `_ - `contextlib.asynccontextmanager `_ Created by the `typecheck `__ checker.