[PR #9662/4d384bd7 backport][stable-10] test helper: fix parameter passing in creation static method (#9663)

test helper: fix parameter passing in creation static method (#9662)

(cherry picked from commit 4d384bd74a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
pull/9668/head
patchback[bot] 2025-02-01 15:01:57 +01:00 committed by GitHub
parent c6aecd18f4
commit 7e4a39964e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class Helper(object):
test_module = sys.modules[test_module_name]
if test_spec is None:
test_spec = test_module.__file__.replace('.py', '.yaml')
return Helper.from_file(test_module, ansible_module, test_spec)
return Helper.from_file(test_module, ansible_module, test_spec, mocks=mocks)
def add_func_to_test_module(self, name, func):
setattr(self.test_module, name, func)