Browse Source

feat: Speed up tests

Postnov Roman 2 days ago
parent
commit
dc196e90c4
  1. 2
      docs_src/security/tutorial004.py
  2. 2
      docs_src/security/tutorial004_an.py
  3. 2
      docs_src/security/tutorial004_an_py310.py
  4. 2
      docs_src/security/tutorial004_an_py39.py
  5. 2
      docs_src/security/tutorial004_py310.py
  6. 2
      docs_src/security/tutorial005.py
  7. 2
      docs_src/security/tutorial005_an.py
  8. 2
      docs_src/security/tutorial005_an_py310.py
  9. 2
      docs_src/security/tutorial005_an_py39.py
  10. 2
      docs_src/security/tutorial005_py310.py
  11. 2
      docs_src/security/tutorial005_py39.py
  12. 1
      tests/test_tutorial/test_sql_databases/test_tutorial001.py
  13. 1
      tests/test_tutorial/test_sql_databases/test_tutorial002.py

2
docs_src/security/tutorial004.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
from typing import Union
import jwt
@ -53,6 +54,7 @@ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial004_an.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
from typing import Union
import jwt
@ -54,6 +55,7 @@ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial004_an_py310.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
from typing import Annotated
import jwt
@ -53,6 +54,7 @@ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial004_an_py39.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
from typing import Annotated, Union
import jwt
@ -53,6 +54,7 @@ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial004_py310.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
import jwt
from fastapi import Depends, FastAPI, HTTPException, status
@ -52,6 +53,7 @@ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial005.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
from typing import List, Union
import jwt
@ -68,6 +69,7 @@ oauth2_scheme = OAuth2PasswordBearer(
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial005_an.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
from typing import List, Union
import jwt
@ -69,6 +70,7 @@ oauth2_scheme = OAuth2PasswordBearer(
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial005_an_py310.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
from typing import Annotated
import jwt
@ -68,6 +69,7 @@ oauth2_scheme = OAuth2PasswordBearer(
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial005_an_py39.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
from typing import Annotated, Union
import jwt
@ -68,6 +69,7 @@ oauth2_scheme = OAuth2PasswordBearer(
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial005_py310.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
import jwt
from fastapi import Depends, FastAPI, HTTPException, Security, status
@ -67,6 +68,7 @@ oauth2_scheme = OAuth2PasswordBearer(
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

2
docs_src/security/tutorial005_py39.py

@ -1,4 +1,5 @@
from datetime import datetime, timedelta, timezone
from functools import lru_cache
from typing import Union
import jwt
@ -68,6 +69,7 @@ oauth2_scheme = OAuth2PasswordBearer(
app = FastAPI()
@lru_cache
def verify_password(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

1
tests/test_tutorial/test_sql_databases/test_tutorial001.py

@ -29,6 +29,7 @@ def clear_sqlmodel():
pytest.param("tutorial001_an_py39", marks=needs_py39),
pytest.param("tutorial001_an_py310", marks=needs_py310),
],
scope="module",
)
def get_client(request: pytest.FixtureRequest):
clear_sqlmodel()

1
tests/test_tutorial/test_sql_databases/test_tutorial002.py

@ -29,6 +29,7 @@ def clear_sqlmodel():
pytest.param("tutorial002_an_py39", marks=needs_py39),
pytest.param("tutorial002_an_py310", marks=needs_py310),
],
scope="module",
)
def get_client(request: pytest.FixtureRequest):
clear_sqlmodel()

Loading…
Cancel
Save