From 14ff684e99939137dd74a77f5285789746f1c417 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 14 Jan 2016 07:53:00 +0100 Subject: [PATCH] bdd: Add a xfail_norun marker. --- pytest.ini | 1 + tests/conftest.py | 2 ++ tests/integration/features/misc.feature | 4 ++-- tests/integration/features/prompts.feature | 2 +- tests/integration/features/search.feature | 7 +++---- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pytest.ini b/pytest.ini index d8ad70b53..4c33f5d5f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -13,6 +13,7 @@ markers = integration: Tests which test a bigger portion of code, run without coverage. skip: Always skipped test. pyqt531_or_newer: Needs PyQt 5.3.1 or newer. + xfail_norun: xfail the test with out running it flakes-ignore = UnusedImport UnusedVariable diff --git a/tests/conftest.py b/tests/conftest.py index c5e5ff2e1..5fe4cda91 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -130,6 +130,8 @@ def pytest_collection_modifyitems(items): item.add_marker(pytest.mark.integration) _apply_platform_markers(item) + if item.get_marker('xfail_norun'): + item.add_marker(pytest.mark.xfail(run=False)) def pytest_ignore_collect(path): diff --git a/tests/integration/features/misc.feature b/tests/integration/features/misc.feature index e6d6c914b..38a77d6e6 100644 --- a/tests/integration/features/misc.feature +++ b/tests/integration/features/misc.feature @@ -293,7 +293,7 @@ Feature: Various utility commands. # :print # Disabled because it causes weird segfaults and QPainter warnings in Qt... - @skip + @xfail_norun Scenario: print preview When I open data/hello.txt And I run :print --preview @@ -305,7 +305,7 @@ Feature: Various utility commands. # printers" qWarning. # # Disabled because it causes weird segfaults and QPainter warnings in Qt... - @skip + @xfail_norun Scenario: print When I open data/hello.txt And I run :print diff --git a/tests/integration/features/prompts.feature b/tests/integration/features/prompts.feature index d266100ae..c472f63e8 100644 --- a/tests/integration/features/prompts.feature +++ b/tests/integration/features/prompts.feature @@ -169,7 +169,7 @@ Feature: Prompts Then the javascript message "notification permission granted" should be logged # This actually gives us a denied rather than an aborted - @skip + @xfail_norun Scenario: notifications with ask -> abort When I set content -> notifications to ask And I open data/prompt/notifications.html diff --git a/tests/integration/features/search.feature b/tests/integration/features/search.feature index 18496a011..ebd2f065d 100644 --- a/tests/integration/features/search.feature +++ b/tests/integration/features/search.feature @@ -28,7 +28,7 @@ Feature: Searching on a page When I run :search doesnotmatch Then the warning "Text 'doesnotmatch' not found on page!" should be shown - @skip + @xfail_norun Scenario: Searching with / and spaces at the end (issue 874) When I run :set-cmd-text -s /space And I run :command-accept @@ -41,9 +41,8 @@ Feature: Searching on a page And I run :yank-selected Then the clipboard should contain "/slash" - # xfail takes a long time to timeout, and this doesn't work because this is - # QtWebKit behaviour. - @skip + # This doesn't work because this is QtWebKit behaviour. + @xfail_norun Scenario: Searching text with umlauts When I run :search blub Then the warning "Text 'blub' not found on page!" should be shown