diff options
author | Matt Clay <matt@mystile.com> | 2018-10-31 19:49:48 -0700 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2018-11-01 09:45:17 -0700 |
commit | 1939f6c412fe3ef4c6860e79d97242aaff31610a (patch) | |
tree | 795ab24e16676a11dd70889c4c6316c8b8561f99 /test/runner | |
parent | f0535bac8087e659e599ffd72ac9853ea3823bd4 (diff) | |
download | ansible-1939f6c412fe3ef4c6860e79d97242aaff31610a.tar.gz |
Fix ansible-test invocation of pytest.
Diffstat (limited to 'test/runner')
-rwxr-xr-x | test/runner/injector/injector.py | 12 |
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: |