File: test_summary.py

package info (click to toggle)
pytest-check 2.7.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 480 kB
  • sloc: python: 2,220; sh: 17; makefile: 6
file content (20 lines) | stat: -rw-r--r-- 614 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import pytest


require_pytest_7_3 = pytest.mark.skipif(
    pytest.version_tuple < (7, 3, 0),
    reason="summary message only supported on pytest7.3+")


@require_pytest_7_3
def test_baseline(pytester):
    pytester.copy_example("examples/test_example_summary.py")
    result = pytester.runpytest("-k check_no_msg")
    result.stdout.fnmatch_lines(["*FAILED*-*check 1 == 2*"])


@require_pytest_7_3
def test_message(pytester):
    pytester.copy_example("examples/test_example_summary.py")
    result = pytester.runpytest("-k check_msg")
    result.stdout.fnmatch_lines(["*FAILED*-*check 1 == 2*comment about*"])