MCPcopy
hub / github.com/pytest-dev/pytest / test_custom_norecursedirs

Method test_custom_norecursedirs

testing/test_collection.py:206–226  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

204 assert _in_venv(base_path) is True
205
206 def test_custom_norecursedirs(self, pytester: Pytester) -> None:
207 pytester.makeini(
208 """
209 [pytest]
210 norecursedirs = mydir xyz*
211 """
212 )
213 tmp_path = pytester.path
214 ensure_file(tmp_path / "mydir" / "test_hello.py").write_text(
215 "def test_1(): pass", encoding="utf-8"
216 )
217 ensure_file(tmp_path / "xyz123" / "test_2.py").write_text(
218 "def test_2(): 0/0", encoding="utf-8"
219 )
220 ensure_file(tmp_path / "xy" / "test_ok.py").write_text(
221 "def test_3(): pass", encoding="utf-8"
222 )
223 rec = pytester.inline_run()
224 rec.assertoutcome(passed=1)
225 rec = pytester.inline_run("xyz123/test_2.py")
226 rec.assertoutcome(failed=1)
227
228 def test_testpaths_ini(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> None:
229 pytester.makeini(

Callers

nothing calls this directly

Calls 5

ensure_fileFunction · 0.85
write_textMethod · 0.80
assertoutcomeMethod · 0.80
makeiniMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected