diff options
author | John L. Villalovos <john@sodarock.com> | 2022-01-06 17:00:49 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-01-08 14:01:26 -0800 |
commit | c9ed3ddc1253c828dc877dcd55000d818c297ee7 (patch) | |
tree | bb2d6a589ad3be8c293c9bfb0057b694a5a36707 | |
parent | d45b59e800a14460a1ecdad2d750e42aa99bb96e (diff) | |
download | gitlab-c9ed3ddc1253c828dc877dcd55000d818c297ee7.tar.gz |
chore: fix functional test failure if config present
Previously c8256a5933d745f70c7eea0a7d6230b51bac0fbc was done to fix
this but it missed two other failures.
-rw-r--r-- | tests/functional/cli/test_cli.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/functional/cli/test_cli.py b/tests/functional/cli/test_cli.py index eb27cb7..97ecacb 100644 --- a/tests/functional/cli/test_cli.py +++ b/tests/functional/cli/test_cli.py @@ -42,11 +42,8 @@ def test_version(script_runner): @responses.activate def test_defaults_to_gitlab_com(script_runner, resp_get_project, monkeypatch): responses.add(**resp_get_project) - with monkeypatch.context() as m: - # Ensure we don't pick up any config files that may already exist in the local - # environment. - m.setattr(config, "_DEFAULT_FILES", []) - ret = script_runner.run("gitlab", "project", "get", "--id", "1") + monkeypatch.setattr(config, "_DEFAULT_FILES", []) + ret = script_runner.run("gitlab", "project", "get", "--id", "1") assert ret.success assert "id: 1" in ret.stdout @@ -55,6 +52,7 @@ def test_defaults_to_gitlab_com(script_runner, resp_get_project, monkeypatch): @responses.activate def test_uses_ci_server_url(monkeypatch, script_runner, resp_get_project): monkeypatch.setenv("CI_SERVER_URL", CI_SERVER_URL) + monkeypatch.setattr(config, "_DEFAULT_FILES", []) resp_get_project_in_ci = copy.deepcopy(resp_get_project) resp_get_project_in_ci.update(url=f"{CI_SERVER_URL}/api/v4/projects/1") @@ -67,6 +65,7 @@ def test_uses_ci_server_url(monkeypatch, script_runner, resp_get_project): @responses.activate def test_uses_ci_job_token(monkeypatch, script_runner, resp_get_project): monkeypatch.setenv("CI_JOB_TOKEN", CI_JOB_TOKEN) + monkeypatch.setattr(config, "_DEFAULT_FILES", []) resp_get_project_in_ci = copy.deepcopy(resp_get_project) resp_get_project_in_ci.update( match=[responses.matchers.header_matcher({"JOB-TOKEN": CI_JOB_TOKEN})], |