Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test_display_callback.py] Use ANSIBLE_PYTHON_INTERPRETER var #336

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions test/integration/test_display_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import yaml
import six

from sys import executable as ANSIBLE_PYTHON_INTERPRETER

from ansible import __version__ as ANSIBLE_VERSION

from ansible_runner.interface import init_runner
Expand All @@ -15,13 +17,21 @@


@pytest.fixture()
def executor(tmpdir, request):
def default_envvars():
return {
"ANSIBLE_PYTHON_INTERPRETER": ANSIBLE_PYTHON_INTERPRETER,
"ANSIBLE_DEPRECATION_WARNINGS": "False"
}


@pytest.fixture()
def executor(tmpdir, request, default_envvars):
private_data_dir = six.text_type(tmpdir.mkdir('foo'))

playbooks = request.node.callspec.params.get('playbook')
playbook = list(playbooks.values())[0]
envvars = request.node.callspec.params.get('envvars')
envvars = envvars.update({"ANSIBLE_DEPRECATION_WARNINGS": "False"}) if envvars is not None else {"ANSIBLE_DEPRECATION_WARNINGS": "False"}
envvars = envvars.update(default_envvars) if envvars is not None else default_envvars

r = init_runner(
private_data_dir=private_data_dir,
Expand Down Expand Up @@ -167,7 +177,7 @@ def test_callback_plugin_no_log_filters(executor, playbook):
- shell: echo "PUBLIC"
- shell: echo "PRIVATE"
no_log: true
- uri: url=https://example.org username="PUBLIC" password="PRIVATE"
- uri: url=https://example.org user="PUBLIC" password="PRIVATE"
- copy: content="PRIVATE" dest="/tmp/tmp_no_log"
'''}, # noqa
])
Expand Down