Skip to content

Commit 8fc8f26

Browse files
committed
docs: update readme about pytest plugin
1 parent 2f2243e commit 8fc8f26

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -700,15 +700,6 @@ markers = [
700700
markers = no_leaks: detect asyncio task leaks, thread leaks, and event loop blocking
701701
```
702702

703-
### Usage
704-
705-
```python
706-
@pytest.mark.no_leaks
707-
@pytest.mark.asyncio
708-
async def test_no_task_leaks():
709-
asyncio.create_task(asyncio.sleep(10))
710-
```
711-
712703
You can also add it to the `conftest.py` file.
713704

714705
```python
@@ -722,6 +713,15 @@ def pytest_configure(config):
722713
)
723714
```
724715

716+
### Usage
717+
718+
```python
719+
@pytest.mark.no_leaks
720+
@pytest.mark.asyncio
721+
async def test_no_task_leaks():
722+
asyncio.create_task(asyncio.sleep(10))
723+
```
724+
725725
### Selective detection
726726

727727
By default, all detectors are enabled. You can selectively enable or disable detectors using the `no_leaks` marker. For example, to only detect task leaks and event loop blocking, you can use the following:

0 commit comments

Comments
 (0)