From f26ce3a8ffaf2f1acad4f58aa592fab587f336a6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 5 Sep 2016 16:48:38 +0200 Subject: [PATCH] Only add BDD markers if condition matches This should make multiple markers on the same test work correctly. --- tests/end2end/conftest.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/end2end/conftest.py b/tests/end2end/conftest.py index 336d22679..09ca18f28 100644 --- a/tests/end2end/conftest.py +++ b/tests/end2end/conftest.py @@ -137,8 +137,6 @@ def pytest_collection_modifyitems(config, items): qtutils.version_check('5.7.1') or os.environ.get('QUTE_QTBUG54419_PATCHED', '')) - # Note the order here is important! Markers we add later override earlier - # markers, so we should apply the most general markers last. markers = [ ('qtwebengine_createWindow', 'Skipped because of QTBUG-54419', pytest.mark.skipif, not qtbug_54419_fixed and config.webengine), @@ -153,7 +151,7 @@ def pytest_collection_modifyitems(config, items): for item in items: for name, prefix, pytest_mark, condition in markers: marker = item.get_marker(name) - if marker: + if marker and condition: if marker.args: text = '{}: {}'.format(prefix, marker.args[0]) else: