@@ -25,14 +25,14 @@ Running pytest now produces this output::
25
25
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
26
26
rootdir: $REGENDOC_TMPDIR, inifile:
27
27
collected 1 item
28
-
28
+
29
29
test_show_warnings.py . [100%]
30
-
30
+
31
31
============================= warnings summary =============================
32
32
test_show_warnings.py::test_one
33
33
$REGENDOC_TMPDIR/test_show_warnings.py:4: UserWarning: api v1, should use functions from v2
34
34
warnings.warn(UserWarning("api v1, should use functions from v2"))
35
-
35
+
36
36
-- Docs: http://doc.pytest.org/en/latest/warnings.html
37
37
=================== 1 passed, 1 warnings in 0.12 seconds ===================
38
38
@@ -45,17 +45,17 @@ them into errors::
45
45
F [100%]
46
46
================================= FAILURES =================================
47
47
_________________________________ test_one _________________________________
48
-
48
+
49
49
def test_one():
50
50
> assert api_v1() == 1
51
-
52
- test_show_warnings.py:8:
53
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
54
-
51
+
52
+ test_show_warnings.py:8:
53
+ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
54
+
55
55
def api_v1():
56
56
> warnings.warn(UserWarning("api v1, should use functions from v2"))
57
57
E UserWarning: api v1, should use functions from v2
58
-
58
+
59
59
test_show_warnings.py:4: UserWarning
60
60
1 failed in 0.12 seconds
61
61
@@ -78,6 +78,9 @@ Both ``-W`` command-line option and ``filterwarnings`` ini option are based on P
78
78
`-W option `_ and `warnings.simplefilter `_, so please refer to those sections in the Python
79
79
documentation for other examples and advanced usage.
80
80
81
+
82
+ .. _`filterwarnings` :
83
+
81
84
``@pytest.mark.filterwarnings ``
82
85
-------------------------------
83
86
0 commit comments