File: test_example_functions_fail.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 (116 lines) | stat: -rw-r--r-- 1,708 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
"""
Failing versions of all of the check helper functions.
"""
from pytest_check import check
import math

def test_equal():
    check.equal(1, 2)


def test_not_equal():
    check.not_equal(1, 1)


def test_is():
    x = ["foo"]
    y = ["foo"]
    check.is_(x, y)


def test_is_not():
    x = ["foo"]
    y = x
    check.is_not(x, y)


def test_is_nan():
    check.is_nan(42)


def test_is_not_nan():
    check.is_not_nan(math.nan)


def test_is_true():
    check.is_true(False)


def test_is_false():
    check.is_false(True)


def test_is_none():
    a = 1
    check.is_none(a)


def test_is_not_none():
    a = None
    check.is_not_none(a)


def test_is_in():
    check.is_in(4, [1, 2, 3])


def test_is_not_in():
    check.is_not_in(2, [1, 2, 3])


def test_is_instance():
    check.is_instance(1, str)


def test_is_not_instance():
    check.is_not_instance(1, int)


def test_almost_equal():
    check.almost_equal(1, 2)
    check.almost_equal(1, 2.1, abs=0.1)
    check.almost_equal(1, 3, rel=1)


def test_not_almost_equal():
    check.not_almost_equal(1, 1)
    check.not_almost_equal(1, 1.1, abs=0.1)
    check.not_almost_equal(1, 2, rel=1)


def test_greater():
    check.greater(1, 2)
    check.greater(1, 1)


def test_greater_equal():
    check.greater_equal(1, 2)


def test_less():
    check.less(2, 1)
    check.less(1, 1)


def test_less_equal():
    check.less_equal(2, 1)


def test_between():
    check.between(0, 0, 20)


def test_between_ge():
    check.between(20, 0, 20, ge=True)


def test_between_le():
    check.between(0, 0, 20, le=True)


def test_between_ge_le():
    check.between(21, 0, 20, ge=True, le=True)


def test_between_equal():
    check.between_equal(21, 0, 20)