Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit864fc12

Browse files
test: fix broken test if user had config files
Use `monkeypatch` to ensure that no config files are reported for thetest.Closes:#2172
1 parent7afd340 commit864fc12

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎tests/unit/test_gitlab.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
importlogging
2121
importpickle
2222
fromhttp.clientimportHTTPConnection
23+
fromtypingimportList,Optional,Union
2324

2425
importpytest
2526
importresponses
@@ -300,7 +301,11 @@ def test_gitlab_from_config(default_config):
300301
gitlab.Gitlab.from_config("one", [config_path])
301302

302303

303-
deftest_gitlab_from_config_without_files_raises():
304+
deftest_gitlab_from_config_without_files_raises(monkeypatch):
305+
defno_files(config_files:Optional[List[str]]=None)->Union[str,List[str]]:
306+
return []
307+
308+
monkeypatch.setattr(gitlab.config,"_get_config_files",no_files)
304309
withpytest.raises(GitlabConfigMissingError,match="non-existing"):
305310
gitlab.Gitlab.from_config("non-existing")
306311

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp