mirror of
https://github.com/ansible/ansible.git
synced 2026-08-05 16:13:06 +02:00
Add type annotations to set_module_args (#85329)
(cherry picked from commit 025e9cfae6)
This commit is contained in:
@@ -15,16 +15,16 @@ assert module_env_mocker is not None # avoid unused imports
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def set_module_args():
|
def set_module_args() -> t.Iterator[t.Callable[[dict[str, t.Any] | None], None]]:
|
||||||
ctx: t.ContextManager | None = None
|
ctx: t.ContextManager | None = None
|
||||||
|
|
||||||
def set_module_args(args):
|
def set_module_args(args: dict[str, t.Any] | None = None) -> None:
|
||||||
nonlocal ctx
|
nonlocal ctx
|
||||||
|
|
||||||
args['_ansible_remote_tmp'] = '/tmp'
|
args['_ansible_remote_tmp'] = '/tmp'
|
||||||
args['_ansible_keep_remote_files'] = False
|
args['_ansible_keep_remote_files'] = False
|
||||||
|
|
||||||
ctx = patch_module_args(args)
|
ctx = t.cast(t.ContextManager, patch_module_args(args))
|
||||||
ctx.__enter__()
|
ctx.__enter__()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user