@@ -275,14 +275,10 @@ def test_missing_permissions_on_unselected_directory_doesnt_crash(
275
275
result.assert_outcomes(passed=1)
276
276
277
277
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
- )
281
278
282
279
@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
286
282
) -> None:
287
283
tmp_path = pytester.path
288
284
ensure_file(tmp_path / build_dir / "test_module.py").write_text(
@@ -292,13 +288,17 @@ def test_build_dirs_collected(
292
288
result = pytester.runpytest("--collect-only").stdout.str()
293
289
assert "test_module" in result
294
290
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
296
295
296
+ ensure_file(tmp_path / "setup.py")
297
297
result = pytester.runpytest("--collect-only").stdout.str()
298
298
assert "test_module" not in result
299
299
300
300
@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 (
302
302
self, pytester: Pytester, build_dir: str
303
303
) -> None:
304
304
tmp_path = pytester.path
@@ -314,7 +314,11 @@ def test_build_dirs_collected_when_setuptools_configuration_present(
314
314
result = pytester.runpytest("--collect-only").stdout.str()
315
315
assert "test_module" in result
316
316
317
- ensure_file(tmp_path / "setup.py")
317
+ ensure_file(tmp_path / "pyproject.toml").write_text(
318
+ '[build-system]\nrequires = ["setuptools", "setuptools-scm"]\n',
319
+ encoding="utf-8",
320
+ )
321
+ result = pytester.runpytest("--collect-only").stdout.str()
318
322
assert "test_module" not in result
319
323
320
324
0 commit comments