From 586ea6fead21c5e613bfc9484e7075dfc518fc33 Mon Sep 17 00:00:00 2001 From: Bruce Schultz Date: Wed, 3 Apr 2024 14:57:58 +0200 Subject: [PATCH] style(test): reorder methods --- tests/conftest.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7b1c0f2..45fcd25 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -19,6 +19,17 @@ def test_client(): yield test_client +@pytest.fixture(scope="package") +def test_token(test_client) -> BearerAuth: + """Get a new access token from the IDP.""" + test_user, test_pwd = "flameuser", "flamepwd" + + resp = test_client.post("/token", data={"username": test_user, "password": test_pwd}) + assert resp.status_code == httpx.codes.OK + token = resp.json()["access_token"] + return BearerAuth(token=token) + + @pytest.fixture(scope="module") def hub_token() -> BearerAuth: """Create an endpoint by which to test the valid JWKS.""" @@ -36,17 +47,6 @@ def hub_token() -> BearerAuth: return BearerAuth(token) -@pytest.fixture(scope="package") -def test_token(test_client) -> BearerAuth: - """Get a new access token from the IDP.""" - test_user, test_pwd = "flameuser", "flamepwd" - - resp = test_client.post("/token", data={"username": test_user, "password": test_pwd}) - assert resp.status_code == httpx.codes.OK - token = resp.json()["access_token"] - return BearerAuth(token=token) - - @pytest.fixture(scope="module") def setup_kong(test_client, test_token): """Setup Kong instance with test data."""