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

Method test_collectonly_simple

testing/test_terminal.py:474–494  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

472 assert result.ret == 3
473
474 def test_collectonly_simple(self, pytester: Pytester) -> None:
475 p = pytester.makepyfile(
476 """
477 def test_func1():
478 pass
479 class TestClass(object):
480 def test_method(self):
481 pass
482 """
483 )
484 result = pytester.runpytest("--collect-only", p)
485 # assert stderr.startswith("inserting into sys.path")
486 assert result.ret == 0
487 result.stdout.fnmatch_lines(
488 [
489 "*<Module *.py>",
490 "* <Function test_func1>",
491 "* <Class TestClass>",
492 "* <Function test_method>",
493 ]
494 )
495
496 def test_collectonly_error(self, pytester: Pytester) -> None:
497 p = pytester.makepyfile("import Errlkjqweqwe")

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected