@@ -58,14 +58,14 @@ them in turn::
58
58
platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
59
59
rootdir: $REGENDOC_TMPDIR, inifile:
60
60
collected 3 items
61
-
61
+
62
62
test_expectation.py ..F
63
-
63
+
64
64
======= FAILURES ========
65
65
_______ test_eval[6*9-42] ________
66
-
66
+
67
67
test_input = '6*9', expected = 42
68
-
68
+
69
69
@pytest.mark.parametrize("test_input,expected", [
70
70
("3+5", 8),
71
71
("2+4", 6),
@@ -75,7 +75,7 @@ them in turn::
75
75
> assert eval(test_input) == expected
76
76
E assert 54 == 42
77
77
E + where 54 = eval('6*9')
78
-
78
+
79
79
test_expectation.py:8: AssertionError
80
80
======= 1 failed, 2 passed in 0.12 seconds ========
81
81
@@ -94,7 +94,8 @@ for example with the builtin ``mark.xfail``::
94
94
@pytest.mark.parametrize("test_input,expected", [
95
95
("3+5", 8),
96
96
("2+4", 6),
97
- pytest.mark.xfail(("6*9", 42)),
97
+ pytest.param("6*9", 42,
98
+ marks=pytest.mark.xfail),
98
99
])
99
100
def test_eval(test_input, expected):
100
101
assert eval(test_input) == expected
@@ -119,11 +120,11 @@ Let's run this::
119
120
$ pytest
120
121
======= test session starts ========
121
122
platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
122
- rootdir: $REGENDOC_TMPDIR, inifile:
123
+ rootdir: $REGENDOC_TMPDIR, inifile:
123
124
collected 3 items
124
-
125
+
125
126
test_expectation.py ..x
126
-
127
+
127
128
======= 2 passed, 1 xfailed in 0.12 seconds ========
128
129
129
130
The one parameter set which caused a failure previously now
@@ -196,15 +197,15 @@ Let's also run with a stringinput that will lead to a failing test::
196
197
F
197
198
======= FAILURES ========
198
199
_______ test_valid_string[!] ________
199
-
200
+
200
201
stringinput = '!'
201
-
202
+
202
203
def test_valid_string(stringinput):
203
204
> assert stringinput.isalpha()
204
205
E assert False
205
206
E + where False = <built-in method isalpha of str object at 0xdeadbeef>()
206
207
E + where <built-in method isalpha of str object at 0xdeadbeef> = '!'.isalpha
207
-
208
+
208
209
test_strings.py:3: AssertionError
209
210
1 failed in 0.12 seconds
210
211
0 commit comments