This is an automated email from the ASF dual-hosted git repository.

potiuk 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 bfb8e497a1a remove useless mock db (#63740)
bfb8e497a1a is described below

commit bfb8e497a1a62967afb682866758244124caaf0c
Author: Henry Chen <[email protected]>
AuthorDate: Sun Mar 22 06:30:10 2026 +0800

    remove useless mock db (#63740)
---
 .../celery/tests/unit/celery/cli/test_celery_command.py   | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/providers/celery/tests/unit/celery/cli/test_celery_command.py 
b/providers/celery/tests/unit/celery/cli/test_celery_command.py
index 1bee35a86e0..b9d0de9f384 100644
--- a/providers/celery/tests/unit/celery/cli/test_celery_command.py
+++ b/providers/celery/tests/unit/celery/cli/test_celery_command.py
@@ -534,6 +534,15 @@ class TestFlowerCommand:
 
 
 class TestRemoteCeleryControlCommands:
+    @pytest.fixture(autouse=True)
+    def _disable_cli_action_logging(self):
+        # Keep these tests as true unit tests: action_cli's default callbacks 
write to DB.
+        with (
+            patch("airflow.utils.cli.cli_action_loggers.on_pre_execution"),
+            patch("airflow.utils.cli.cli_action_loggers.on_post_execution"),
+        ):
+            yield
+
     @classmethod
     def setup_class(cls):
         with conf_vars({("core", "executor"): "CeleryExecutor"}):
@@ -541,7 +550,6 @@ class TestRemoteCeleryControlCommands:
             importlib.reload(cli_parser)
             cls.parser = cli_parser.get_parser()
 
-    @pytest.mark.db_test
     
@mock.patch("airflow.providers.celery.executors.celery_executor.app.control.inspect")
     def test_list_celery_workers(self, mock_inspect):
         args = self.parser.parse_args(["celery", "list-workers", "--output", 
"json"])
@@ -559,7 +567,6 @@ class TestRemoteCeleryControlCommands:
             assert key in celery_workers[0]
         assert any("celery@host_1" in h["worker_name"] for h in celery_workers)
 
-    @pytest.mark.db_test
     
@mock.patch("airflow.providers.celery.executors.celery_executor.app.control.shutdown")
     def test_shutdown_worker(self, mock_shutdown):
         args = self.parser.parse_args(["celery", "shutdown-worker", "-H", 
"celery@host_1"])
@@ -569,7 +576,6 @@ class TestRemoteCeleryControlCommands:
             celery_command.shutdown_worker(args)
             
mock_shutdown.assert_called_once_with(destination=["celery@host_1"])
 
-    @pytest.mark.db_test
     
@mock.patch("airflow.providers.celery.executors.celery_executor.app.control.broadcast")
     def test_shutdown_all_workers(self, mock_broadcast):
         args = self.parser.parse_args(["celery", "shutdown-all-workers", "-y"])
@@ -579,7 +585,6 @@ class TestRemoteCeleryControlCommands:
             celery_command.shutdown_all_workers(args)
             mock_broadcast.assert_called_once_with("shutdown")
 
-    @pytest.mark.db_test
     
@mock.patch("airflow.providers.celery.executors.celery_executor.app.control.add_consumer")
     def test_add_queue(self, mock_add_consumer):
         args = self.parser.parse_args(["celery", "add-queue", "-q", "test1", 
"-H", "celery@host_1"])
@@ -589,7 +594,6 @@ class TestRemoteCeleryControlCommands:
             celery_command.add_queue(args)
             mock_add_consumer.assert_called_once_with("test1", 
destination=["celery@host_1"])
 
-    @pytest.mark.db_test
     
@mock.patch("airflow.providers.celery.executors.celery_executor.app.control.cancel_consumer")
     def test_remove_queue(self, mock_cancel_consumer):
         args = self.parser.parse_args(["celery", "remove-queue", "-q", 
"test1", "-H", "celery@host_1"])
@@ -599,7 +603,6 @@ class TestRemoteCeleryControlCommands:
             celery_command.remove_queue(args)
             mock_cancel_consumer.assert_called_once_with("test1", 
destination=["celery@host_1"])
 
-    @pytest.mark.db_test
     
@mock.patch("airflow.providers.celery.executors.celery_executor.app.control.cancel_consumer")
     
@mock.patch("airflow.providers.celery.executors.celery_executor.app.control.inspect")
     def test_remove_all_queues(self, mock_inspect, mock_cancel_consumer):

Reply via email to