File: test_example_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 (32 lines) | stat: -rw-r--r-- 512 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Make sure the @check.check_func decorator works.
"""

from pytest_check import check_func


@check_func
def is_five(a):
    assert a == 5


def test_pass():
    is_five(5)


def test_pass_return_val_of_check_helper():
    assert is_five(5) is True


@check_func
def is_four(a):
    assert a == 4


def test_all_four():
    is_four(1)
    is_four(2)
    should_be_False = is_four(3)
    should_be_True = is_four(4)
    print(f"should_be_True={should_be_True}")
    print(f"should_be_False={should_be_False}")