Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import pytest

from tests_common.test_utils.asserts import assert_queries_count
from tests_common.test_utils.markers import skip_if_force_lowest_dependencies_marker

pytestmark = pytest.mark.db_test
Expand Down Expand Up @@ -63,7 +64,8 @@ def test_should_respond_200(
):
pytest.importorskip("flask_appbuilder") # Remove after upgrading to FAB5

response = test_client.get("/plugins", params=query_params)
with assert_queries_count(2):
response = test_client.get("/plugins", params=query_params)
assert response.status_code == 200

body = response.json()
Expand All @@ -73,7 +75,8 @@ def test_should_respond_200(
def test_external_views_model_validator(self, test_client):
pytest.importorskip("flask_appbuilder") # Remove after upgrading to FAB5

response = test_client.get("plugins")
with assert_queries_count(2):
response = test_client.get("plugins")
body = response.json()

test_plugin = next((plugin for plugin in body["plugins"] if plugin["name"] == "test_plugin"), None)
Expand Down Expand Up @@ -156,7 +159,8 @@ class TestGetPluginImportErrors:
new={"plugins/test_plugin.py": "something went wrong"},
)
def test_should_respond_200(self, test_client, session):
response = test_client.get("/plugins/importErrors")
with assert_queries_count(2):
response = test_client.get("/plugins/importErrors")
assert response.status_code == 200

body = response.json()
Expand Down