diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2022-01-02 18:30:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-02 18:30:14 +0100 |
commit | 2ac2a689defb2f959c4b53b9a179aa80a7178777 (patch) | |
tree | 6a51a02a025aa2c9a739cb9dc1e82058769b717c | |
parent | a3eafab725ed0a30d1d35207f4941937f0aab886 (diff) | |
parent | c8256a5933d745f70c7eea0a7d6230b51bac0fbc (diff) | |
download | gitlab-2ac2a689defb2f959c4b53b9a179aa80a7178777.tar.gz |
Merge pull request #1792 from python-gitlab/jlvillal/cli_test
chore: fix functional test failure if config present
-rw-r--r-- | tests/functional/cli/test_cli.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/functional/cli/test_cli.py b/tests/functional/cli/test_cli.py index 2384563..b9a0e67 100644 --- a/tests/functional/cli/test_cli.py +++ b/tests/functional/cli/test_cli.py @@ -3,7 +3,7 @@ import json import pytest import responses -from gitlab import __version__ +from gitlab import __version__, config @pytest.fixture @@ -30,9 +30,13 @@ def test_version(script_runner): @pytest.mark.script_launch_mode("inprocess") -def test_defaults_to_gitlab_com(script_runner, resp_get_project): - # Runs in-process to intercept requests to gitlab.com - ret = script_runner.run("gitlab", "project", "get", "--id", "1") +def test_defaults_to_gitlab_com(script_runner, resp_get_project, monkeypatch): + 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", []) + # Runs in-process to intercept requests to gitlab.com + ret = script_runner.run("gitlab", "project", "get", "--id", "1") assert ret.success assert "id: 1" in ret.stdout |