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

Method test_all

testing/test_pastebin.py:40–72  ·  view source on GitHub ↗
(self, pytester: Pytester, pastebinlist)

Source from the content-addressed store, hash-verified

38 assert reprec.countoutcomes() == [1, 1, 1]
39
40 def test_all(self, pytester: Pytester, pastebinlist) -> None:
41 from _pytest.pytester import LineMatcher
42
43 testpath = pytester.makepyfile(
44 """
45 import pytest
46 def test_pass():
47 pass
48 def test_fail():
49 assert 0
50 def test_skip():
51 pytest.skip("")
52 """
53 )
54 reprec = pytester.inline_run(
55 testpath,
56 "--pastebin=all",
57 "-v",
58 "-W",
59 "ignore:The --pastebin:DeprecationWarning",
60 )
61 assert reprec.countoutcomes() == [1, 1, 1]
62 assert len(pastebinlist) == 1
63 contents = pastebinlist[0].decode("utf-8")
64 matcher = LineMatcher(contents.splitlines())
65 matcher.fnmatch_lines(
66 [
67 "*test_pass PASSED*",
68 "*test_fail FAILED*",
69 "*test_skip SKIPPED*",
70 "*== 1 failed, 1 passed, 1 skipped in *",
71 ]
72 )
73
74 def test_non_ascii_paste_text(self, pytester: Pytester, pastebinlist) -> None:
75 """Make sure that text which contains non-ascii characters is pasted

Callers

nothing calls this directly

Calls 5

fnmatch_linesMethod · 0.95
LineMatcherClass · 0.90
countoutcomesMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected