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

Method test_all

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

Source from the content-addressed store, hash-verified

34 assert reprec.countoutcomes() == [1, 1, 1]
35
36 def test_all(self, pytester: Pytester, pastebinlist) -> None:
37 from _pytest.pytester import LineMatcher
38
39 testpath = pytester.makepyfile(
40 """
41 import pytest
42 def test_pass():
43 pass
44 def test_fail():
45 assert 0
46 def test_skip():
47 pytest.skip("")
48 """
49 )
50 reprec = pytester.inline_run(testpath, "--pastebin=all", "-v")
51 assert reprec.countoutcomes() == [1, 1, 1]
52 assert len(pastebinlist) == 1
53 contents = pastebinlist[0].decode("utf-8")
54 matcher = LineMatcher(contents.splitlines())
55 matcher.fnmatch_lines(
56 [
57 "*test_pass PASSED*",
58 "*test_fail FAILED*",
59 "*test_skip SKIPPED*",
60 "*== 1 failed, 1 passed, 1 skipped in *",
61 ]
62 )
63
64 def test_non_ascii_paste_text(self, pytester: Pytester, pastebinlist) -> None:
65 """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