diff options
Diffstat (limited to 'testing/web-platform/tests/tools/pytest/doc/en/example/xfail_demo.py')
-rw-r--r-- | testing/web-platform/tests/tools/pytest/doc/en/example/xfail_demo.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/pytest/doc/en/example/xfail_demo.py b/testing/web-platform/tests/tools/pytest/doc/en/example/xfail_demo.py new file mode 100644 index 000000000..5648575e8 --- /dev/null +++ b/testing/web-platform/tests/tools/pytest/doc/en/example/xfail_demo.py @@ -0,0 +1,30 @@ +import pytest +xfail = pytest.mark.xfail + +@xfail +def test_hello(): + assert 0 + +@xfail(run=False) +def test_hello2(): + assert 0 + +@xfail("hasattr(os, 'sep')") +def test_hello3(): + assert 0 + +@xfail(reason="bug 110") +def test_hello4(): + assert 0 + +@xfail('pytest.__version__[0] != "17"') +def test_hello5(): + assert 0 + +def test_hello6(): + pytest.xfail("reason") + +@xfail(raises=IndexError) +def test_hello7(): + x = [] + x[1] = 1 |