This is an automated email from the ASF dual-hosted git repository.
pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new caeb0373706 Add number of queries guard in public plugins list
endpoints (#57562)
caeb0373706 is described below
commit caeb0373706a138f3fccb05ae4ca06013810e582
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Fri Oct 31 11:37:37 2025 +0100
Add number of queries guard in public plugins list endpoints (#57562)
---
.../unit/api_fastapi/core_api/routes/public/test_plugins.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_plugins.py
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_plugins.py
index 17f20f6816b..2d77c4881b1 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_plugins.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_plugins.py
@@ -20,6 +20,7 @@ from unittest.mock import patch
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
@@ -61,7 +62,8 @@ class TestGetPlugins:
def test_should_respond_200(
self, test_client, session, query_params, expected_total_entries,
expected_names
):
- 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()
@@ -69,7 +71,8 @@ class TestGetPlugins:
assert [plugin["name"] for plugin in body["plugins"]] == expected_names
def test_external_views_model_validator(self, test_client):
- 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)
@@ -163,7 +166,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()