Commit c9b39e08 authored by Roman Yurchak's avatar Roman Yurchak

Add pytest --run-xfail run option

parent 5728cfde
......@@ -24,6 +24,9 @@ try:
group.addoption(
'--build-dir', action="store", default=BUILD_PATH,
help="Path to the build directory")
group.addoption(
'--run-xfail', action="store_true",
help="If provided, tests marked as xfail will be run")
except ImportError:
pytest = None
......
# Test modules with a failure reason after their name are either skipped
# or marked as a known failure in pytest.
#
# Following reason codes are skipped, whithout running them, as they lead to
# segfaults:
# Following reason codes are skipped, as they lead to segfaults:
# - segfault-<syscall>: segfault in the corresponding system call.
#
# While the below reason codes are marked as a known failure, and are still
# executed:
# While the below reason codes are marked as a known failure. By default, they
# are also skipped. To run them, provide --run-xfail argument to pytest,
# - platform-specific: This is testing something about a particular platform
# that isn't relevant here
# - async: relies on async
......
......@@ -352,9 +352,13 @@ def test_cpython_core(python_test, selenium, request):
.format(','.join(error_flags)))
if error_flags:
request.applymarker(pytest.mark.xfail(
run=False, reason='known failure with code "{}"'
.format(','.join(error_flags))))
if request.config.option.run_xfail:
request.applymarker(pytest.mark.xfail(
run=False, reason='known failure with code "{}"'
.format(','.join(error_flags))))
else:
pytest.xfail('known failure with code "{}"'
.format(','.join(error_flags)))
selenium.load_package('test')
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment