@@ -240,27 +240,25 @@ def test_load_empty_pyproject_toml_from_config_argument(_, tmpdir):
240240
241241class TestWarnMultipleConfigFiles :
242242 @pytest .mark .parametrize (
243- "files,expected_path,should_warn " ,
243+ "files,expected_path" ,
244244 [
245245 # Same directory, different file types
246- ([(".cz.toml" , PYPROJECT ), (".cz.json" , JSON_STR )], ".cz.toml" , True ),
247- ([(".cz.json" , JSON_STR ), (".cz.yaml" , YAML_STR )], ".cz.json" , True ),
248- ([(".cz.toml" , PYPROJECT ), (".cz.yaml" , YAML_STR )], ".cz.toml" , True ),
249- # With pyproject.toml (excluded from warning)
246+ ([(".cz.toml" , PYPROJECT ), (".cz.json" , JSON_STR )], ".cz.toml" ),
247+ ([(".cz.json" , JSON_STR ), (".cz.yaml" , YAML_STR )], ".cz.json" ),
248+ ([(".cz.toml" , PYPROJECT ), (".cz.yaml" , YAML_STR )], ".cz.toml" ),
249+ # With pyproject.toml
250250 (
251251 [("pyproject.toml" , PYPROJECT ), (".cz.json" , JSON_STR )],
252252 ".cz.json" ,
253- False ,
254253 ),
255254 (
256255 [("pyproject.toml" , PYPROJECT ), (".cz.toml" , PYPROJECT )],
257256 ".cz.toml" ,
258- False ,
259257 ),
260258 ],
261259 )
262260 def test_warn_multiple_config_files_same_dir (
263- _ , tmpdir , capsys , files , expected_path , should_warn
261+ _ , tmpdir , capsys , files , expected_path
264262 ):
265263 """Test warning when multiple config files exist in same directory."""
266264 with tmpdir .as_cwd ():
@@ -270,19 +268,12 @@ def test_warn_multiple_config_files_same_dir(
270268 cfg = config .read_cfg ()
271269 captured = capsys .readouterr ()
272270
273- if should_warn :
274- assert "Multiple config files detected" in captured .err
275- assert "Using" in captured .err
276- for filename , _ in files :
277- if filename != "pyproject.toml" :
278- assert filename in captured .err
279- else :
280- assert "Multiple config files detected" not in captured .err
271+ assert "Multiple config files detected" in captured .err
272+ for filename , _ in files :
273+ assert filename in captured .err
274+ assert f"Using config file: '{ expected_path } '" in captured .err
281275
282276 assert cfg .path == Path (expected_path )
283- # Verify config loaded correctly (name and version match expected)
284- assert cfg .settings ["name" ] == "cz_jira"
285- assert cfg .settings ["version" ] == "1.0.0"
286277
287278 @pytest .mark .parametrize (
288279 "config_file,content" ,
0 commit comments