Skip to content

Commit bc97f6a

Browse files
committed
fix precommit
1 parent 3065fdf commit bc97f6a

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 24.8.0
3+
rev: 24.10.0
44
hooks:
55
- id: black
66
args: ["--target-version=py38"]
77

88
- repo: https://github.com/asottile/blacken-docs
9-
rev: 1.17.0
9+
rev: 1.19.0
1010
hooks:
1111
- id: blacken-docs
1212
args: ["--target-version=py38"]
@@ -17,14 +17,14 @@ repos:
1717
- id: isort
1818

1919
- repo: https://github.com/pre-commit/pre-commit-hooks
20-
rev: v4.6.0
20+
rev: v5.0.0
2121
hooks:
2222
- id: trailing-whitespace
2323
- id: end-of-file-fixer
2424
- id: debug-statements
2525

2626
- repo: https://github.com/mgedmin/check-manifest
27-
rev: "0.49"
27+
rev: "0.50"
2828
hooks:
2929
- id: check-manifest
3030
args: [--no-build-isolation]
@@ -40,13 +40,14 @@ repos:
4040
hooks:
4141
- id: validate-pyproject
4242

43-
- repo: https://github.com/kieran-ryan/pyprojectsort
44-
rev: "v0.3.0"
45-
hooks:
46-
- id: pyprojectsort
43+
# conflict with the backend dependencies: tomli-w==1.1.0 is incompatible with tomli-w==1.0.0.
44+
# - repo: https://github.com/kieran-ryan/pyprojectsort
45+
# rev: "v0.3.0"
46+
# hooks:
47+
# - id: pyprojectsort
4748

4849
- repo: https://github.com/python-jsonschema/check-jsonschema
49-
rev: "0.29.3"
50+
rev: "0.29.4"
5051
hooks:
5152
- id: check-github-workflows
5253
- id: check-readthedocs

tests/test_api_jwt.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -832,18 +832,16 @@ def test_encode_decode_sub_claim(self, jwt):
832832
assert decoded["sub"] == "user123"
833833

834834
def test_decode_without_and_not_required_sub_claim(self, jwt):
835-
payload = {}
836835
secret = "your-256-bit-secret"
837-
token = jwt.encode(payload, secret, algorithm="HS256")
836+
token = jwt.encode({}, secret, algorithm="HS256")
838837

839838
decoded = jwt.decode(token, secret, algorithms=["HS256"])
840839

841840
assert "sub" not in decoded
842841

843842
def test_decode_missing_sub_but_required_claim(self, jwt):
844-
payload = {}
845843
secret = "your-256-bit-secret"
846-
token = jwt.encode(payload, secret, algorithm="HS256")
844+
token = jwt.encode({}, secret, algorithm="HS256")
847845

848846
with pytest.raises(MissingRequiredClaimError):
849847
jwt.decode(
@@ -918,9 +916,8 @@ def test_decode_missing_jti_when_required_claim(self, jwt):
918916
assert "jti" in str(exc_info.value)
919917

920918
def test_decode_missing_jti_claim(self, jwt):
921-
payload = {}
922919
secret = "your-256-bit-secret"
923-
token = jwt.encode(payload, secret, algorithm="HS256")
920+
token = jwt.encode({}, secret, algorithm="HS256")
924921

925922
decoded = jwt.decode(token, secret, algorithms=["HS256"])
926923

0 commit comments

Comments
 (0)