File tree 4 files changed +23
-1
lines changed
4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ Nicolas Delaby
69
69
Pieter Mulder
70
70
Piotr Banaszkiewicz
71
71
Punyashloka Biswal
72
+ Quentin Pradet
72
73
Ralf Schmitt
73
74
Raphael Pierzina
74
75
Ronny Pfannschmidt
Original file line number Diff line number Diff line change 7
7
8
8
*
9
9
10
- *
10
+ * Fix ``pytest.mark.skip `` mark when used in strict mode.
11
+ Thanks `@pquentin `_ for the PR and `@RonnyPfannschmidt `_ for
12
+ showing how to fix the bug.
11
13
12
14
* Minor improvements and fixes to the documentation.
13
15
Thanks `@omarkohl `_ for the PR.
165
167
.. _@rabbbit : https://github.com/rabbbit
166
168
.. _@hackebrot : https://github.com/hackebrot
167
169
.. _@omarkohl : https://github.com/omarkohl
170
+ .. _@pquentin : https://github.com/pquentin
168
171
169
172
2.8.7
170
173
=====
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ def nop(*args, **kwargs):
30
30
nop .Exception = XFailed
31
31
setattr (pytest , "xfail" , nop )
32
32
33
+ config .addinivalue_line ("markers" ,
34
+ "skip(reason=None): skip the given test function with an optional reason. "
35
+ "Example: skip(reason=\" no way of currently testing this\" ) skips the "
36
+ "test."
37
+ )
33
38
config .addinivalue_line ("markers" ,
34
39
"skipif(condition): skip the given test function if eval(condition) "
35
40
"results in a True value. Evaluation happens within the "
Original file line number Diff line number Diff line change @@ -539,6 +539,19 @@ def test_baz():
539
539
"*1 passed*2 skipped*" ,
540
540
])
541
541
542
+ def test_strict_and_skip (self , testdir ):
543
+ testdir .makepyfile ("""
544
+ import pytest
545
+ @pytest.mark.skip
546
+ def test_hello():
547
+ pass
548
+ """ )
549
+ result = testdir .runpytest ("-rs --strict" )
550
+ result .stdout .fnmatch_lines ([
551
+ "*unconditional skip*" ,
552
+ "*1 skipped*" ,
553
+ ])
554
+
542
555
class TestSkipif :
543
556
def test_skipif_conditional (self , testdir ):
544
557
item = testdir .getitem ("""
You can’t perform that action at this time.
0 commit comments