asyncio style refactoring
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
from fastapi import Request
|
||||
|
||||
from src.service.auth.auth import CurrentUserService
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def current_user_service()->CurrentUserService:
|
||||
@pytest_asyncio.fixture
|
||||
async def current_user_service()->CurrentUserService:
|
||||
current_user_service=CurrentUserService()
|
||||
return current_user_service
|
||||
|
||||
@pytest.fixture
|
||||
def requests(mocker):
|
||||
@pytest_asyncio.fixture
|
||||
async def requests(mocker):
|
||||
fake_request = mocker.MagicMock(spec=Request)
|
||||
fake_request.headers = {"user-agent": "pytest-agent", "x-forwarded-for":"127.0.0.1"}
|
||||
return fake_request
|
||||
Reference in New Issue
Block a user