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

Function test_preload_options

t/unit/app/test_preload_cli.py:35–61  ·  view source on GitHub ↗
(subcommand_with_params: Tuple[str, ...], isolated_cli_runner: CliRunner)

Source from the content-addressed store, hash-verified

33 ]
34)
35def test_preload_options(subcommand_with_params: Tuple[str, ...], isolated_cli_runner: CliRunner):
36 # Verify commands like shell and purge can accept preload options.
37 # Projects like Pyramid-Celery's ini option should be valid preload
38 # options.
39 res_without_preload = isolated_cli_runner.invoke(
40 celery,
41 ["-A", "t.unit.bin.proj.app", *subcommand_with_params, "--ini", "some_ini.ini"],
42 catch_exceptions=False,
43 )
44
45 assert "No such option" in res_without_preload.output
46 assert "--ini" in res_without_preload.output
47 assert res_without_preload.exit_code == 2
48
49 res_with_preload = isolated_cli_runner.invoke(
50 celery,
51 [
52 "-A",
53 "t.unit.bin.proj.pyramid_celery_app",
54 *subcommand_with_params,
55 "--ini",
56 "some_ini.ini",
57 ],
58 catch_exceptions=False,
59 )
60
61 assert res_with_preload.exit_code == 0, res_with_preload.output
62
63
64@contextlib.contextmanager

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected