Skip to content

Commit

Permalink
add tests for gitlab and github_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Nov 17, 2020
1 parent 1bf6df1 commit 916d860
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/tox.yml
Expand Up @@ -25,17 +25,17 @@ jobs:
- tox_env: lint
- tox_env: docs
- tox_env: py36
PREFIX: PYTEST_REQPASS=418
PREFIX: PYTEST_REQPASS=420
- tox_env: py37
PREFIX: PYTEST_REQPASS=418
PREFIX: PYTEST_REQPASS=420
- tox_env: py38
PREFIX: PYTEST_REQPASS=418
PREFIX: PYTEST_REQPASS=420
- tox_env: py39
PREFIX: PYTEST_REQPASS=418
PREFIX: PYTEST_REQPASS=420
- tox_env: py36-devel
PREFIX: PYTEST_REQPASS=418
PREFIX: PYTEST_REQPASS=420
- tox_env: py39-devel
PREFIX: PYTEST_REQPASS=418
PREFIX: PYTEST_REQPASS=420
- tox_env: packaging
- tox_env: eco
- tox_env: dockerfile
Expand Down
11 changes: 9 additions & 2 deletions src/molecule/test/unit/command/test_base.py
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 @@ -226,7 +228,12 @@ def test_execute_cmdline_scenarios_exit_nodestroy(

@pytest.mark.parametrize(
"_patched_ci_env",
[{"TRAVIS": None, "CI": None}, {"TRAVIS": "true", "CI": "true"}],
[
{},
{"CI": "true", "TRAVIS": "true"},
{"CI": "true", "GITHUB_ACTIONS": "true"},
{"CI": "true", "GITLAB_CI": "true"},
],
indirect=True,
)
def test_execute_subcommand(config_instance, _patched_ci_env):
Expand Down

0 comments on commit 916d860

Please sign in to comment.