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

Function test_exclude_glob

testing/test_session.py:277–289  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

275
276
277def test_exclude_glob(pytester: Pytester) -> None:
278 hellodir = pytester.mkdir("hello")
279 hellodir.joinpath("test_hello.py").write_text("x y syntaxerror")
280 hello2dir = pytester.mkdir("hello2")
281 hello2dir.joinpath("test_hello2.py").write_text("x y syntaxerror")
282 hello3dir = pytester.mkdir("hallo3")
283 hello3dir.joinpath("test_hello3.py").write_text("x y syntaxerror")
284 subdir = pytester.mkdir("sub")
285 subdir.joinpath("test_hello4.py").write_text("x y syntaxerror")
286 pytester.makepyfile(test_ok="def test_pass(): pass")
287 result = pytester.runpytest("--ignore-glob=*h[ea]llo*")
288 assert result.ret == 0
289 result.stdout.fnmatch_lines(["*1 passed*"])
290
291
292def test_deselect(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
mkdirMethod · 0.45
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected