Skip to content

Commit 3fbc786

Browse files
committed
chore: dependency update
1 parent 01db099 commit 3fbc786

File tree

5 files changed

+420
-461
lines changed

5 files changed

+420
-461
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: 'v0.9.3'
4+
rev: 'v0.11.3'
55
hooks:
66
- id: ruff
77
args: [--fix, --exit-non-zero-on-fix]
@@ -16,7 +16,7 @@ repos:
1616
exclude: "\\.svg$|\\.map$|\\.min\\.css$|\\.min\\.js$|\\.po$|\\.pot$"
1717
- id: check-toml
1818
- repo: https://github.com/codespell-project/codespell
19-
rev: v2.4.0
19+
rev: v2.4.1
2020
hooks:
2121
- id: codespell
2222
additional_dependencies:

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ classifiers = [
2929
repository = "https://github.com/pytest-dev/pytest-iam"
3030
documentation = "https://pytest-iam.readthedocs.io/en/latest/"
3131

32-
requires-python = ">=3.9"
32+
requires-python = ">=3.10"
3333
dependencies = [
34-
"canaille[oidc]==0.0.54",
34+
"canaille[oidc]>=0.0.71",
3535
"portpicker>=1.6.0",
3636
"pytest>=7.0.0",
3737
"faker>=21.0.0",
@@ -91,7 +91,6 @@ requires = ["tox>=4.19"]
9191
env_list = [
9292
"doc",
9393
"style",
94-
"py39",
9594
"py310",
9695
"py311",
9796
"py312",

pytest_iam/__init__.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime
2+
import os
23
import threading
34
import uuid
45
import wsgiref.simple_server
@@ -138,14 +139,21 @@ def consent(self, user, client=None):
138139

139140

140141
@pytest.fixture(scope="session")
141-
def iam_configuration(tmp_path_factory) -> dict[str, Any]:
142+
def iam_server_port():
143+
return portpicker.pick_unused_port()
144+
145+
146+
@pytest.fixture(scope="session")
147+
def iam_configuration(tmp_path_factory, iam_server_port) -> dict[str, Any]:
142148
"""Fixture for editing the configuration of :meth:`~pytest_iam.iam_server`."""
143149
private_key, public_key = generate_keypair()
150+
os.environ["AUTHLIB_INSECURE_TRANSPORT"] = "1"
144151
return {
145152
"TESTING": True,
146153
"ENV_FILE": None,
147154
"SECRET_KEY": str(uuid.uuid4()),
148155
"WTF_CSRF_ENABLED": False,
156+
"SERVER_NAME": f"localhost:{iam_server_port}",
149157
"CANAILLE": {
150158
"JAVASCRIPT": False,
151159
"ACL": {
@@ -180,13 +188,12 @@ def iam_configuration(tmp_path_factory) -> dict[str, Any]:
180188

181189

182190
@pytest.fixture(scope="session")
183-
def iam_server(iam_configuration) -> Server:
191+
def iam_server(iam_configuration, iam_server_port) -> Server:
184192
"""Fixture that creates a Canaille server listening a random port in a thread."""
185-
port = portpicker.pick_unused_port()
186193
app = create_app(
187194
config=iam_configuration, env_file=".pytest-iam.env", env_prefix="PYTEST_IAM_"
188195
)
189-
server = Server(app, port, Backend.instance)
196+
server = Server(app, iam_server_port, Backend.instance)
190197

191198
server_thread = threading.Thread(target=server.httpd.serve_forever)
192199
server_thread.start()

tests/test_client_application.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def test_server_configuration(iam_server):
1212
res = requests.get(f"{iam_server.url}/.well-known/openid-configuration")
13-
assert res.json()["issuer"] == iam_server.url
13+
assert res.json()["issuer"] in iam_server.url
1414

1515

1616
def test_client_dynamic_registration(iam_server):
@@ -31,7 +31,7 @@ def test_client_dynamic_registration(iam_server):
3131

3232
client = iam_server.backend.get(iam_server.models.Client, client_id=client_id)
3333
assert client.client_secret == client_secret
34-
client.delete()
34+
iam_server.backend.delete(client)
3535

3636

3737
def test_logs(iam_server, caplog):
@@ -52,7 +52,7 @@ def test_logs(iam_server, caplog):
5252

5353
client_id = response.json()["client_id"]
5454
client = iam_server.backend.get(iam_server.models.Client, client_id=client_id)
55-
client.delete()
55+
iam_server.backend.delete(client)
5656

5757

5858
@pytest.fixture

0 commit comments

Comments
 (0)