This is an automated email from the ASF dual-hosted git repository.
kaxil 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 5929485c9ce Fix the default connections sort test passing on an empty
list (#72055)
5929485c9ce is described below
commit 5929485c9ce58e19d2800117e064b1a3cd6d83c5
Author: PoAn Yang <[email protected]>
AuthorDate: Thu Sep 17 10:57:53 2026 +0900
Fix the default connections sort test passing on an empty list (#72055)
* Fix the default connections sort test passing on an empty list
Signed-off-by: PoAn Yang <[email protected]>
* Assert conn_ids is not empty
Signed-off-by: PoAn Yang <[email protected]>
---------
Signed-off-by: PoAn Yang <[email protected]>
---
airflow-core/tests/unit/utils/test_db.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/airflow-core/tests/unit/utils/test_db.py
b/airflow-core/tests/unit/utils/test_db.py
index a33f7b667f4..f4e2901fa30 100644
--- a/airflow-core/tests/unit/utils/test_db.py
+++ b/airflow-core/tests/unit/utils/test_db.py
@@ -17,7 +17,6 @@
# under the License.
from __future__ import annotations
-import inspect
import logging
import os
import re
@@ -45,8 +44,8 @@ from airflow.utils.db import (
check_team_names_can_be_lower_cased,
compare_server_default,
compare_type,
- create_default_connections,
downgrade,
+ get_default_connections,
initdb,
resetdb,
upgradedb,
@@ -229,10 +228,9 @@ class TestDb:
check(config)
def test_default_connections_sort(self):
- pattern = re.compile("conn_id=[\"|'](.*?)[\"|']", re.DOTALL)
- source = inspect.getsource(create_default_connections)
- src = pattern.findall(source)
- assert sorted(src) == src
+ conn_ids = [c.conn_id for c in get_default_connections()]
+ assert conn_ids
+ assert conn_ids == sorted(conn_ids)
@pytest.mark.usefixtures("initialized_db")
def test_check_migrations(self):