MCPcopy Create free account
hub / github.com/celery/celery / test_cli_disable_prefetch_flag

Function test_cli_disable_prefetch_flag

t/unit/bin/test_worker.py:76–86  ·  view source on GitHub ↗
(isolated_cli_runner: CliRunner)

Source from the content-addressed store, hash-verified

74
75
76def test_cli_disable_prefetch_flag(isolated_cli_runner: CliRunner):
77 Logging._setup = True
78 with patch('celery.bin.worker.worker.callback') as worker_callback_mock:
79 res = isolated_cli_runner.invoke(
80 celery,
81 ["-A", "t.unit.bin.proj.app", "worker", "--pool", "solo", "--disable-prefetch"],
82 catch_exceptions=False,
83 )
84 assert res.exit_code == 0
85 _, kwargs = worker_callback_mock.call_args
86 assert kwargs['disable_prefetch'] is True
87
88
89def test_disable_prefetch_affects_qos_behavior(mock_app, mock_consumer):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected