Skip to content

Commit

Permalink
simplify patched_ci_env for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Nov 16, 2020
1 parent 5178e65 commit 5fddbb4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/molecule/test/unit/command/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def _patched_sysexit(mocker):
@pytest.fixture
def _patched_ci_env(request, monkeypatch):
"""Parametrize tests with and without CI env vars."""
for envvar, value in request.param.items():
envvars = {"CI": None, "TRAVIS": None, "GITHUB_ACTIONS": None, "GITLAB_CI": None}
envvars.update(request.param)
for envvar, value in envvars.items():
if value is None:
monkeypatch.delenv(envvar, raising=False)
else:
Expand Down Expand Up @@ -227,7 +229,7 @@ def test_execute_cmdline_scenarios_exit_nodestroy(
@pytest.mark.parametrize(
"_patched_ci_env",
[
{"CI": None, "TRAVIS": None, "GITHUB_ACTIONS": None, "GITLAB_CI": None},
{},
{"CI": "true", "TRAVIS": "true"},
{"CI": "true", "GITHUB_ACTIONS": "true"},
{"CI": "true", "GITLAB_CI": "true"},
Expand Down

0 comments on commit 5fddbb4

Please sign in to comment.