File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,26 @@ def test_build_dirs_collected(
297
297
result = pytester .runpytest ("--collect-only" ).stdout .str ()
298
298
assert "test_module" not in result
299
299
300
+ @known_build_dirs
301
+ def test_build_dirs_collected_when_setuptools_configuration_present (
302
+ self , pytester : Pytester , build_dir : str
303
+ ) -> None :
304
+ tmp_path = pytester .path
305
+ ensure_file (tmp_path / build_dir / "test_module.py" ).write_text (
306
+ "def test_hello(): pass" , encoding = "utf-8"
307
+ )
308
+
309
+ result = pytester .runpytest ("--collect-only" ).stdout .str ()
310
+ assert "test_module" in result
311
+
312
+ ensure_file (tmp_path / "setup.cfg" )
313
+
314
+ result = pytester .runpytest ("--collect-only" ).stdout .str ()
315
+ assert "test_module" in result
316
+
317
+ ensure_file (tmp_path / "setup.py" )
318
+ assert "test_module" not in result
319
+
300
320
301
321
class TestCollectPluginHookRelay :
302
322
def test_pytest_collect_file (self , pytester : Pytester ) -> None :
You can’t perform that action at this time.
0 commit comments