Debian Codegraph @

doc/en/example/xfail_demo.py

raw
1 from __future__ import annotations
2
3 import pytest
4
5
6 xfail = pytest.mark.xfail
7
8
9 @xfail
10 def test_hello():
11 assert 0
12
13
14 @xfail(run=False)
15 def test_hello2():
16 assert 0
17
18
19 @xfail("hasattr(os, 'sep')")
20 def test_hello3():
21 assert 0
22
23
24 @xfail(reason="bug 110")
25 def test_hello4():
26 assert 0
27
28
29 @xfail('pytest.__version__[0] != "17"')
30 def test_hello5():
31 assert 0
32
33
34 def test_hello6():
35 pytest.xfail("reason")
36
37
38 @xfail(raises=IndexError)
39 def test_hello7():
40 x = []
41 x[1] = 1