From 205af3737f6160a6b8c31edc1908fc76e7f5ca81 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 13 Nov 2015 06:54:45 +0100 Subject: [PATCH] bdd: Skip yankpaste tests if clipboard is broken. This seems to be the case on OS X Yosemite (on my Mac Mini). --- tests/integration/features/test_yankpaste.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/integration/features/test_yankpaste.py b/tests/integration/features/test_yankpaste.py index 21a73e377..d8091f277 100644 --- a/tests/integration/features/test_yankpaste.py +++ b/tests/integration/features/test_yankpaste.py @@ -27,6 +27,18 @@ import pytest_bdd as bdd bdd.scenarios('yankpaste.feature') +@pytest.fixture(autouse=True) +def skip_with_broken_clipboard(qapp): + """The clipboard seems to be broken on some platforms (OS X Yosemite?). + + This skips the tests if this is the case. + """ + clipboard = qapp.clipboard() + clipboard.setText("Does this work?") + if clipboard.text() != "Does this work?": + pytest.skip("Clipboard seems to be broken on this platform.") + + def _get_mode(qapp, what): """Get the QClipboard::Mode to use based on a string.""" if what == 'clipboard':