tests: Improve @qtwebengine_* markers
This uses xfail for @qtwebengine_todo and adds a new @qtwebengine_skip marker.
This commit is contained in:
parent
dfed2f9c9c
commit
8d381aaa01
@ -16,6 +16,7 @@ markers =
|
|||||||
ci: Tests which should only run on CI.
|
ci: Tests which should only run on CI.
|
||||||
flaky_once: Try to rerun this test once if it fails
|
flaky_once: Try to rerun this test once if it fails
|
||||||
qtwebengine_todo: Features still missing with QtWebEngine
|
qtwebengine_todo: Features still missing with QtWebEngine
|
||||||
|
qtwebengine_skip: Tests not applicable with QtWebEngine
|
||||||
qt_log_level_fail = WARNING
|
qt_log_level_fail = WARNING
|
||||||
qt_log_ignore =
|
qt_log_ignore =
|
||||||
^SpellCheck: .*
|
^SpellCheck: .*
|
||||||
|
@ -39,11 +39,20 @@ def pytest_collection_modifyitems(config, items):
|
|||||||
"""Apply @qtwebengine_* markers."""
|
"""Apply @qtwebengine_* markers."""
|
||||||
webengine = config.getoption('--qute-bdd-webengine')
|
webengine = config.getoption('--qute-bdd-webengine')
|
||||||
|
|
||||||
|
markers = {
|
||||||
|
'qtwebengine_todo': ('QtWebEngine TODO', pytest.mark.xfail),
|
||||||
|
'qtwebengine_skip': ('Skipped with QtWebEngine', pytest.mark.skipif),
|
||||||
|
}
|
||||||
|
|
||||||
for item in items:
|
for item in items:
|
||||||
marker = item.get_marker('qtwebengine_todo')
|
for name, (prefix, pytest_mark) in markers.items():
|
||||||
if marker:
|
marker = item.get_marker(name)
|
||||||
text = 'QtWebEngine TODO: {}'.format(marker.args[0])
|
if marker:
|
||||||
item.add_marker(pytest.mark.skipif(webengine, reason=text))
|
if marker.args:
|
||||||
|
text = '{}: {}'.format(prefix, marker.args[0])
|
||||||
|
else:
|
||||||
|
text = prefix
|
||||||
|
item.add_marker(pytest_mark(webengine, reason=text))
|
||||||
|
|
||||||
|
|
||||||
@pytest.hookimpl(hookwrapper=True)
|
@pytest.hookimpl(hookwrapper=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user