Skip to content

Commit d35394d

Browse files
fix: resolve ruff RUF033 and test assertion after msgspec removal
- Remove default value from CustomToken.__post_init__ leeway param (defaults should be on InitVar field, not __post_init__ parameter) - Pass random_field as int since msgspec type coercion is no longer used
1 parent 77a91fa commit d35394d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/unit/test_security/test_jwt/test_auth.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ def handler(request: Request[Any, CustomToken, Any]) -> dict[str, Any]:
191191
jwt_auth.create_token(
192192
"foo",
193193
token_extras={"foo": "bar"},
194-
# pass a string here as value to ensure things get converted properly
195-
random_field="2",
194+
random_field=2,
196195
),
197196
)
198197

@@ -851,7 +850,7 @@ async def test_jwt_auth_verify_exp(
851850
) -> None:
852851
@dataclasses.dataclass
853852
class CustomToken(Token):
854-
def __post_init__(self, leeway: float = 0) -> None:
853+
def __post_init__(self, leeway: float) -> None:
855854
pass
856855

857856
jwt_auth, client = create_jwt_app(verify_expiry=verify_expiry, token_cls=CustomToken)

0 commit comments

Comments
 (0)