From 33f7758db01f1ddb23ffcc196fc7af46ad8dbbef Mon Sep 17 00:00:00 2001 From: Joao-Pedro-P-Holanda Date: Thu, 13 Feb 2025 20:39:40 -0300 Subject: [PATCH] fix: removing Annotated usages removing Annotated to keep compatibility with python 3.8 --- tests/test_security_oauth2_scopes.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/test_security_oauth2_scopes.py b/tests/test_security_oauth2_scopes.py index 9d55081e1..7bd0e6c2c 100644 --- a/tests/test_security_oauth2_scopes.py +++ b/tests/test_security_oauth2_scopes.py @@ -1,5 +1,3 @@ -from typing import Annotated - from fastapi import FastAPI, Security from fastapi.params import Depends from fastapi.security import OAuth2PasswordBearer @@ -14,24 +12,20 @@ oauth2_scheme = OAuth2PasswordBearer( ) -def get_security_scopes( - security_scopes: SecurityScopes, token: Annotated[str, Depends(oauth2_scheme)] -): +def get_security_scopes(security_scopes: SecurityScopes, token=Depends(oauth2_scheme)): return security_scopes.scopes @app.get("/me") async def read_single_scope( - current_scope: Annotated[list[str], Security(get_security_scopes, scopes="me")], + current_scope=Security(get_security_scopes, scopes="me"), ): return {"scopes": current_scope} @app.get("/me-and-items") async def read_single_scope( - current_scope: Annotated[ - list[str], Security(get_security_scopes, scopes=["me", "items"]) - ], + current_scope=Security(get_security_scopes, scopes=["me", "items"]), ): return {"scopes": current_scope}