File: test_tb_style.py

package info (click to toggle)
pytest-check 2.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 432 kB
  • sloc: python: 1,775; sh: 17; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 713 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
from pytest import LineMatcher


def test_traceback_style_no(pytester):
    pytester.copy_example("examples/test_example_tb_style.py")
    result = pytester.runpytest("--junitxml=output.xml", "--tb=no")
    result.assert_outcomes(failed=1, passed=0)
    with open("output.xml") as f:
        lines = LineMatcher(f.readlines())
        lines.no_fnmatch_line("*run_helper1()*")


def test_traceback_style_default(pytester):
    pytester.copy_example("examples/test_example_tb_style.py")
    result = pytester.runpytest("--junitxml=output.xml")
    result.assert_outcomes(failed=1, passed=0)
    with open("output.xml") as f:
        lines = LineMatcher(f.readlines())
        lines.fnmatch_lines("*run_helper1()*")