File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,7 @@ def pytest_addoption(parser: Parser) -> None:
6363 "*.egg" ,
6464 ".*" ,
6565 "_darcs" ,
66- "build" ,
6766 "CVS" ,
68- "dist" ,
6967 "node_modules" ,
7068 "venv" ,
7169 "{arch}" ,
Original file line number Diff line number Diff line change @@ -135,10 +135,19 @@ def test_foo():
135135
136136
137137class TestCollectFS :
138+ def test_build_conditional_ignore (self , pytester : Pytester ) -> None :
139+ tmp_path = pytester .path
140+ ensure_file (tmp_path / "build" / "test_found.py" )
141+ ensure_file (tmp_path / "dist" / "test_found.py" )
142+ for x in tmp_path .rglob ("test_*.py" ):
143+ x .write_text ("def test_hello(): pass" , encoding = "utf-8" )
144+
145+ result = pytester .runpytest ("--collect-only" )
146+ s = result .stdout .str ()
147+ assert "test_found" in s
148+
138149 def test_ignored_certain_directories (self , pytester : Pytester ) -> None :
139150 tmp_path = pytester .path
140- ensure_file (tmp_path / "build" / "test_notfound.py" )
141- ensure_file (tmp_path / "dist" / "test_notfound.py" )
142151 ensure_file (tmp_path / "_darcs" / "test_notfound.py" )
143152 ensure_file (tmp_path / "CVS" / "test_notfound.py" )
144153 ensure_file (tmp_path / "{arch}" / "test_notfound.py" )
You can’t perform that action at this time.
0 commit comments