diff options
author | TomV <tom@viner.tv> | 2016-04-19 15:21:19 +0100 |
---|---|---|
committer | TomV <tom@viner.tv> | 2016-04-19 18:12:37 +0100 |
commit | 99c4b6fdc3ab07a9b9876147428339ca62f5a227 (patch) | |
tree | e60b9c9b6dd03e17b6aa1aa91067af9c680eb9cf /testing/test_skipping.py | |
parent | 6a3c943ce26de52737eac083fb692610bf1fce35 (diff) | |
download | pytest-99c4b6fdc3ab07a9b9876147428339ca62f5a227.tar.gz |
issue 1496 - xfail with condition keyword
Diffstat (limited to 'testing/test_skipping.py')
-rw-r--r-- | testing/test_skipping.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 194c8692b..2bfb6a8dc 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -405,6 +405,19 @@ class TestXFail: result.stdout.fnmatch_lines('*1 passed*') assert result.ret == 0 + @pytest.mark.parametrize('strict', [True, False]) + def test_xfail_condition_keyword(self, testdir, strict): + p = testdir.makepyfile(""" + import pytest + + @pytest.mark.xfail(condition=False, reason='unsupported feature', strict=%s) + def test_foo(): + pass + """ % strict) + result = testdir.runpytest(p, '-rxX') + result.stdout.fnmatch_lines('*1 passed*') + assert result.ret == 0 + @pytest.mark.parametrize('strict_val', ['true', 'false']) def test_strict_xfail_default_from_file(self, testdir, strict_val): testdir.makeini(''' |