Skip to content

Commit

Permalink
chore: Update pytest-asyncio mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sondrelg committed May 16, 2022
1 parent 1883b31 commit 8b30e44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tool:pytest]
testpaths = tests
asyncio_mode = auto

[flake8]
max-line-length = 120
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from logging.config import dictConfig

import pytest
import pytest_asyncio
from fastapi import FastAPI
from httpx import AsyncClient
from starlette.middleware import Middleware
Expand Down Expand Up @@ -61,7 +62,7 @@ def event_loop():
loop.close()


@pytest.fixture(scope='module')
@pytest_asyncio.fixture(scope='module')
async def client() -> AsyncClient:
async with AsyncClient(app=default_app, base_url='http://test') as client:
yield client

0 comments on commit 8b30e44

Please sign in to comment.