File: test_check_func_decorator.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-- 740 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
def test_passing_check_helper_functions(pytester):
    pytester.copy_example("examples/test_example_check_func_decorator.py")
    result = pytester.runpytest("-k", "test_pass")
    result.assert_outcomes(passed=2)


def test_failing_check_helper_functions(pytester):
    pytester.copy_example("examples/test_example_check_func_decorator.py")
    result = pytester.runpytest("-s", "-k", "test_all_four")
    result.assert_outcomes(failed=1, passed=0)
    result.stdout.fnmatch_lines(
        [
            "*should_be_True=True*",
            "*should_be_False=False*",
            "*FAILURE: assert 1 == 4*",
            "*FAILURE: assert 2 == 4*",
            "*FAILURE: assert 3 == 4*",
            "*Failed Checks: 3*",
        ],
    )