[flake8-async] Fix examples to use async with (#12924)

This commit is contained in:
Micha Reiser 2024-08-16 12:24:59 +02:00 committed by GitHub
parent d8debb7a36
commit 9b73532b11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -32,7 +32,7 @@ use crate::rules::flake8_async::helpers::AsyncModule;
/// ///
/// ///
/// async def main(): /// async def main():
/// with asyncio.timeout(2): /// async with asyncio.timeout(2):
/// await long_running_task() /// await long_running_task()
/// ``` /// ```
/// ///

View file

@ -22,14 +22,14 @@ use crate::rules::flake8_async::helpers::MethodName;
/// ## Example /// ## Example
/// ```python /// ```python
/// async def func(): /// async def func():
/// with asyncio.timeout(2): /// async with asyncio.timeout(2):
/// do_something() /// do_something()
/// ``` /// ```
/// ///
/// Use instead: /// Use instead:
/// ```python /// ```python
/// async def func(): /// async def func():
/// with asyncio.timeout(2): /// async with asyncio.timeout(2):
/// do_something() /// do_something()
/// await awaitable() /// await awaitable()
/// ``` /// ```