@@ -42,11 +42,8 @@ def test_version(script_runner):
4242@responses .activate
4343def test_defaults_to_gitlab_com (script_runner , resp_get_project , monkeypatch ):
4444 responses .add (** resp_get_project )
45- with monkeypatch .context () as m :
46- # Ensure we don't pick up any config files that may already exist in the local
47- # environment.
48- m .setattr (config , "_DEFAULT_FILES" , [])
49- ret = script_runner .run ("gitlab" , "project" , "get" , "--id" , "1" )
45+ monkeypatch .setattr (config , "_DEFAULT_FILES" , [])
46+ ret = script_runner .run ("gitlab" , "project" , "get" , "--id" , "1" )
5047 assert ret .success
5148 assert "id: 1" in ret .stdout
5249
@@ -55,6 +52,7 @@ def test_defaults_to_gitlab_com(script_runner, resp_get_project, monkeypatch):
5552@responses .activate
5653def test_uses_ci_server_url (monkeypatch , script_runner , resp_get_project ):
5754 monkeypatch .setenv ("CI_SERVER_URL" , CI_SERVER_URL )
55+ monkeypatch .setattr (config , "_DEFAULT_FILES" , [])
5856 resp_get_project_in_ci = copy .deepcopy (resp_get_project )
5957 resp_get_project_in_ci .update (url = f"{ CI_SERVER_URL } /api/v4/projects/1" )
6058
@@ -67,6 +65,7 @@ def test_uses_ci_server_url(monkeypatch, script_runner, resp_get_project):
6765@responses .activate
6866def test_uses_ci_job_token (monkeypatch , script_runner , resp_get_project ):
6967 monkeypatch .setenv ("CI_JOB_TOKEN" , CI_JOB_TOKEN )
68+ monkeypatch .setattr (config , "_DEFAULT_FILES" , [])
7069 resp_get_project_in_ci = copy .deepcopy (resp_get_project )
7170 resp_get_project_in_ci .update (
7271 match = [responses .matchers .header_matcher ({"JOB-TOKEN" : CI_JOB_TOKEN })],
0 commit comments