tests: Skip unittests with QUTE_BDD_WEBENGINE
This commit is contained in:
parent
aec0e4ca40
commit
ebf093bb6e
@ -129,8 +129,9 @@ if not getattr(sys, 'frozen', False):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.hookimpl(trylast=True)
|
||||||
def pytest_collection_modifyitems(config, items):
|
def pytest_collection_modifyitems(config, items):
|
||||||
"""Apply @qtwebengine_* markers."""
|
"""Apply @qtwebengine_* markers; skip unittests with QUTE_BDD_WEBENGINE."""
|
||||||
vercheck = qtutils.version_check
|
vercheck = qtutils.version_check
|
||||||
qtbug_54419_fixed = ((vercheck('5.6.2') and not vercheck('5.7.0')) or
|
qtbug_54419_fixed = ((vercheck('5.6.2') and not vercheck('5.7.0')) or
|
||||||
qtutils.version_check('5.7.1') or
|
qtutils.version_check('5.7.1') or
|
||||||
@ -157,3 +158,14 @@ def pytest_collection_modifyitems(config, items):
|
|||||||
text = prefix
|
text = prefix
|
||||||
item.add_marker(pytest_mark(condition, reason=text,
|
item.add_marker(pytest_mark(condition, reason=text,
|
||||||
**marker.kwargs))
|
**marker.kwargs))
|
||||||
|
|
||||||
|
if os.environ.get('QUTE_BDD_WEBENGINE', ''):
|
||||||
|
remaining = []
|
||||||
|
deselected = []
|
||||||
|
for item in items:
|
||||||
|
if not item.get_marker('end2end'):
|
||||||
|
deselected.append(item)
|
||||||
|
else:
|
||||||
|
remaining.append(item)
|
||||||
|
config.hook.pytest_deselected(items=deselected)
|
||||||
|
items[:] = remaining
|
||||||
|
Loading…
Reference in New Issue
Block a user