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

Method test_collect_single_item

testing/test_terminal.py:336–345  ·  view source on GitHub ↗

Use singular 'item' when reporting a single test item

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

334 result.stdout.fnmatch_lines(["*KeyboardInterrupt*"])
335
336 def test_collect_single_item(self, pytester: Pytester) -> None:
337 """Use singular 'item' when reporting a single test item"""
338 pytester.makepyfile(
339 """
340 def test_foobar():
341 pass
342 """
343 )
344 result = pytester.runpytest()
345 result.stdout.fnmatch_lines(["collected 1 item"])
346
347 def test_rewrite(self, pytester: Pytester, monkeypatch) -> None:
348 config = pytester.parseconfig()

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected