@@ -275,14 +275,10 @@ def test_missing_permissions_on_unselected_directory_doesnt_crash(
275275 result .assert_outcomes (passed = 1 )
276276
277277 known_build_dirs = pytest .mark .parametrize ("build_dir" , ["build" , "dist" ])
278- known_buildsystem_env = pytest .mark .parametrize (
279- "buildsystem_indicator_file" , ["setup.py" , "setup.cfg" , "pyproject.toml" ]
280- )
281278
282279 @known_build_dirs
283- @known_buildsystem_env
284- def test_build_dirs_collected (
285- self , pytester : Pytester , build_dir : str , buildsystem_indicator_file : str
280+ def test_build_dirs_collected_when_setuptools_setup_py_present (
281+ self , pytester : Pytester , build_dir : str
286282 ) -> None :
287283 tmp_path = pytester .path
288284 ensure_file (tmp_path / build_dir / "test_module.py" ).write_text (
@@ -292,13 +288,17 @@ def test_build_dirs_collected(
292288 result = pytester .runpytest ("--collect-only" ).stdout .str ()
293289 assert "test_module" in result
294290
295- ensure_file (tmp_path / buildsystem_indicator_file )
291+ ensure_file (tmp_path / "setup.cfg" )
292+
293+ result = pytester .runpytest ("--collect-only" ).stdout .str ()
294+ assert "test_module" in result
296295
296+ ensure_file (tmp_path / "setup.py" )
297297 result = pytester .runpytest ("--collect-only" ).stdout .str ()
298298 assert "test_module" not in result
299299
300300 @known_build_dirs
301- def test_build_dirs_collected_when_setuptools_configuration_present (
301+ def test_build_dirs_collected_when_setuptools_present_in_pyproject_toml (
302302 self , pytester : Pytester , build_dir : str
303303 ) -> None :
304304 tmp_path = pytester .path
@@ -314,7 +314,11 @@ def test_build_dirs_collected_when_setuptools_configuration_present(
314314 result = pytester .runpytest ("--collect-only" ).stdout .str ()
315315 assert "test_module" in result
316316
317- ensure_file (tmp_path / "setup.py" )
317+ ensure_file (tmp_path / "pyproject.toml" ).write_text (
318+ '[build-system]\n requires = ["setuptools", "setuptools-scm"]\n ' ,
319+ encoding = "utf-8" ,
320+ )
321+ result = pytester .runpytest ("--collect-only" ).stdout .str ()
318322 assert "test_module" not in result
319323
320324
0 commit comments