Skip to content

Commit

Permalink
Adjust to changes in flask-oidc
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Nov 3, 2023
1 parent 6c275a2 commit dbc11b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ def client(app):
return app.test_client()


@pytest.fixture
def mocked_responses():
with responses.RequestsMock() as rsps:
@pytest.fixture()
def mock_oidc():
with responses.RequestsMock(assert_all_requests_are_fired=False) as rsps:
rsps.get("https://id.example.com/openidc/.well-known/openid-configuration", json={})
yield rsps


Expand Down
10 changes: 1 addition & 9 deletions tests/test_ui_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,15 @@
from unittest.mock import Mock, patch

import pytest
import responses

# TODO: use parametrize


@pytest.fixture(autouse=True)
def setup_all(db_items):
def setup_all(db_items, mock_oidc):
pass


@pytest.fixture(autouse=True)
def mock_oidc():
with responses.RequestsMock(assert_all_requests_are_fired=False) as rsps:
rsps.get("https://id.example.com/openidc/.well-known/openid-configuration", json={})
yield


def handle_flask_admin_urls(client, url):
if url.endswith("/"):
url = url[:-1]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ui_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@pytest.fixture(autouse=True)
def setup_all(db_items):
def setup_all(db_items, mock_oidc):
skip = os.getenv("MM2_SKIP_NETWORK_TESTS", 0)
if skip:
raise pytest.skip("Skipping FlaskUiAppTest tests")
Expand Down

0 comments on commit dbc11b9

Please sign in to comment.