(isolated_cli_runner: CliRunner)
| 74 | |
| 75 | |
| 76 | def 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 | |
| 89 | def test_disable_prefetch_affects_qos_behavior(mock_app, mock_consumer): |
nothing calls this directly
no outgoing calls
no test coverage detected