Skip to content

Commit 0e34059

Browse files
committed
GH-5: Use httpx.AsyncClient for testing async routes
1 parent 354035a commit 0e34059

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_oauth2_middleware.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
from fastapi import APIRouter
1+
import pytest
22
from fastapi import FastAPI
3-
from fastapi.testclient import TestClient
3+
from httpx import AsyncClient
4+
from social_core.backends.github import GithubOAuth2
45

6+
from fastapi_oauth2.client import OAuth2Client
57
from fastapi_oauth2.middleware import OAuth2Middleware
68
from fastapi_oauth2.router import router as oauth2_router
79

810
app = FastAPI()
9-
router = APIRouter()
1011

1112
app.include_router(oauth2_router)
1213
app.add_middleware(OAuth2Middleware, config={})
1314

14-
client = TestClient(app)
1515

1616

1717
def test_read_main():

0 commit comments

Comments
 (0)