File: test_fail_func.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 (16 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def test_fail_func(pytester):
    pytester.copy_example("examples/test_example_fail_func.py")
    result = pytester.runpytest("--check-max-tb=2")
    result.assert_outcomes(failed=2)
    result.stdout.fnmatch_lines(
        [
            "*FAILURE: one",
            "*test_one_failure() -> check.fail('one')",
            "Failed Checks: 1",
            "*FAILURE: one",
            "*test_two_failures() -> check.fail('one')",
            "*FAILURE: two",
            "*test_two_failures() -> check.fail('two')",
            "Failed Checks: 2",
        ],
    )