@@ -16,44 +16,58 @@ def _write_config(tmp_path, data: dict) -> str:
1616
1717def test_env_var_substitution (tmp_path , monkeypatch ):
1818 monkeypatch .setenv ('TEST_GH_TOKEN' , 'ghp_secret123' )
19- path = _write_config (tmp_path , {
20- 'github' : {'token' : '${TEST_GH_TOKEN}' },
21- 'repos' : [{'name' : 'r' , 'path' : '/tmp/r' , 'provider' : 'github' }],
22- })
19+ path = _write_config (
20+ tmp_path ,
21+ {
22+ 'github' : {'token' : '${TEST_GH_TOKEN}' },
23+ 'repos' : [{'name' : 'r' , 'path' : '/tmp/r' , 'provider' : 'github' }],
24+ },
25+ )
2326 config = load_global_config (path )
2427 assert config .github .token == 'ghp_secret123'
2528
2629
2730def test_missing_env_var_raises (tmp_path , monkeypatch ):
2831 monkeypatch .delenv ('NONEXISTENT_VAR_XYZ' , raising = False )
29- path = _write_config (tmp_path , {
30- 'github' : {'token' : '${NONEXISTENT_VAR_XYZ}' },
31- 'repos' : [{'name' : 'r' , 'path' : '/tmp/r' , 'provider' : 'github' }],
32- })
32+ path = _write_config (
33+ tmp_path ,
34+ {
35+ 'github' : {'token' : '${NONEXISTENT_VAR_XYZ}' },
36+ 'repos' : [{'name' : 'r' , 'path' : '/tmp/r' , 'provider' : 'github' }],
37+ },
38+ )
3339 with pytest .raises (ValueError , match = 'NONEXISTENT_VAR_XYZ is not set' ):
3440 load_global_config (path )
3541
3642
3743def test_max_concurrent_reviews_parsed (tmp_path ):
38- path = _write_config (tmp_path , {
39- 'max_concurrent_reviews' : 8 ,
40- 'repos' : [{'name' : 'r' , 'path' : '/tmp/r' , 'provider' : 'github' }],
41- })
44+ path = _write_config (
45+ tmp_path ,
46+ {
47+ 'max_concurrent_reviews' : 8 ,
48+ 'repos' : [{'name' : 'r' , 'path' : '/tmp/r' , 'provider' : 'github' }],
49+ },
50+ )
4251 config = load_global_config (path )
4352 assert config .max_concurrent_reviews == 8
4453
4554
4655def test_max_concurrent_reviews_default (tmp_path ):
47- path = _write_config (tmp_path , {
48- 'repos' : [{'name' : 'r' , 'path' : '/tmp/r' , 'provider' : 'github' }],
49- })
56+ path = _write_config (
57+ tmp_path ,
58+ {
59+ 'repos' : [{'name' : 'r' , 'path' : '/tmp/r' , 'provider' : 'github' }],
60+ },
61+ )
5062 config = load_global_config (path )
5163 assert config .max_concurrent_reviews == 4
5264
5365
5466def test_git_env_has_terminal_prompt_disabled ():
5567 from reviewd .reviewer import _GIT_ENV
68+
5669 assert _GIT_ENV ['GIT_TERMINAL_PROMPT' ] == '0'
5770
5871 from reviewd .config import _GIT_ENV as _CONFIG_GIT_ENV
72+
5973 assert _CONFIG_GIT_ENV ['GIT_TERMINAL_PROMPT' ] == '0'
0 commit comments