MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_custom_norecursedirs

Method test_custom_norecursedirs

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

Source from the content-addressed store, hash-verified

223 assert _in_venv(base_path) is True
224
225 def test_custom_norecursedirs(self, pytester: Pytester) -> None:
226 pytester.makeini(
227 """
228 [pytest]
229 norecursedirs = mydir xyz*
230 """
231 )
232 tmp_path = pytester.path
233 ensure_file(tmp_path / "mydir" / "test_hello.py").write_text(
234 "def test_1(): pass"
235 )
236 ensure_file(tmp_path / "xyz123" / "test_2.py").write_text("def test_2(): 0/0")
237 ensure_file(tmp_path / "xy" / "test_ok.py").write_text("def test_3(): pass")
238 rec = pytester.inline_run()
239 rec.assertoutcome(passed=1)
240 rec = pytester.inline_run("xyz123/test_2.py")
241 rec.assertoutcome(failed=1)
242
243 def test_testpaths_ini(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> None:
244 pytester.makeini(

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected