Skip to content

Commit 2ac2a68

Browse files
authored
Merge pull request #1792 from python-gitlab/jlvillal/cli_test
chore: fix functional test failure if config present
2 parents a3eafab + c8256a5 commit 2ac2a68

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/functional/cli/test_cli.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44
import responses
55

6-
from gitlab import __version__
6+
from gitlab import __version__, config
77

88

99
@pytest.fixture
@@ -30,9 +30,13 @@ def test_version(script_runner):
3030

3131

3232
@pytest.mark.script_launch_mode("inprocess")
33-
def test_defaults_to_gitlab_com(script_runner, resp_get_project):
34-
# Runs in-process to intercept requests to gitlab.com
35-
ret = script_runner.run("gitlab", "project", "get", "--id", "1")
33+
def test_defaults_to_gitlab_com(script_runner, resp_get_project, monkeypatch):
34+
with monkeypatch.context() as m:
35+
# Ensure we don't pick up any config files that may already exist in the local
36+
# environment.
37+
m.setattr(config, "_DEFAULT_FILES", [])
38+
# Runs in-process to intercept requests to gitlab.com
39+
ret = script_runner.run("gitlab", "project", "get", "--id", "1")
3640
assert ret.success
3741
assert "id: 1" in ret.stdout
3842

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy