summaryrefslogtreecommitdiff
path: root/test/runner
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2018-10-31 19:49:48 -0700
committerMatt Clay <matt@mystile.com>2018-11-01 09:45:17 -0700
commit1939f6c412fe3ef4c6860e79d97242aaff31610a (patch)
tree795ab24e16676a11dd70889c4c6316c8b8561f99 /test/runner
parentf0535bac8087e659e599ffd72ac9853ea3823bd4 (diff)
downloadansible-1939f6c412fe3ef4c6860e79d97242aaff31610a.tar.gz
Fix ansible-test invocation of pytest.
Diffstat (limited to 'test/runner')
-rwxr-xr-xtest/runner/injector/injector.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/runner/injector/injector.py b/test/runner/injector/injector.py
index 8fb1f1166d..d9a66cb91d 100755
--- a/test/runner/injector/injector.py
+++ b/test/runner/injector/injector.py
@@ -151,14 +151,22 @@ def injector():
:rtype: list[str], dict[str, str]
"""
command = os.path.basename(__file__)
- executable = find_executable(command)
+
+ run_as_python_module = (
+ 'pytest',
+ )
+
+ if command in run_as_python_module:
+ executable_args = ['-m', command]
+ else:
+ executable_args = [find_executable(command)]
if config.coverage_file:
args, env = coverage_command()
else:
args, env = [config.python_interpreter], os.environ.copy()
- args += [executable]
+ args += executable_args
if command in ('ansible', 'ansible-playbook', 'ansible-pull'):
if config.remote_interpreter is None: