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

Function reset_command_params_between_each_test

t/unit/app/test_preload_cli.py:16–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14
15@pytest.fixture(autouse=True)
16def reset_command_params_between_each_test():
17 with contextlib.ExitStack() as stack:
18 for command in celery.commands.values():
19 # We only need shallow copy -- preload options are appended to the list,
20 # existing options are kept as-is
21 params_copy = command.params[:]
22 patch_instance = patch.object(command, "params", params_copy)
23 stack.enter_context(patch_instance)
24
25 yield
26
27
28@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

objectMethod · 0.80

Tested by

no test coverage detected