| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ | |||
| 3 | 3 | import pytest | |
| 4 | 4 | import responses | |
| 5 | 5 | ||
| 6 | - from gitlab import __version__ | ||
| 6 | + from gitlab import __version__, config | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | @pytest.fixture | |
@@ -30,9 +30,13 @@ def test_version(script_runner): | |||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | 32 | @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") | ||
| 36 | 40 | assert ret.success | |
| 37 | 41 | assert "id: 1" in ret.stdout | |
| 38 | 42 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments