Skip to content

Commit e7086f2

Browse files
author
Deep Chand
committed
fix: add type narrowing for pyright reportOptionalSubscript
Add `assert token.claims is not None` before subscript access in test_access_token_with_claims to satisfy pyright's type narrowing. Equality comparison (`== custom_claims`) does not narrow Optional types. Github-Issue:#2119
1 parent 2054cb6 commit e7086f2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/server/auth/test_provider.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def test_access_token_with_claims():
4646
scopes=["read"],
4747
claims=custom_claims,
4848
)
49+
assert token.claims is not None
4950
assert token.claims == custom_claims
5051
assert token.claims["org_id"] == "org_7"
5152
assert token.claims["roles"] == ["admin", "editor"]

0 commit comments

Comments
 (0)