From 24dc166e1f374714db611aa1bcd3953041a5423b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 16 Oct 2015 06:24:29 +0200 Subject: [PATCH] tests: Use extend=True for qt_log_ignore marks. This should finally resolve the warning flakiness on OS X. --- tests/unit/browser/test_webelem.py | 2 +- tests/unit/misc/test_guiprocess.py | 2 +- tests/unit/utils/test_error.py | 3 ++- tests/unit/utils/test_qtutils.py | 8 +++++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/unit/browser/test_webelem.py b/tests/unit/browser/test_webelem.py index bed604fa1..2979473a3 100644 --- a/tests/unit/browser/test_webelem.py +++ b/tests/unit/browser/test_webelem.py @@ -644,7 +644,7 @@ class TestJavascriptEscape: """Test javascript escaping with a real QWebPage.""" self._test_escape(text, qtbot, webframe) - @pytest.mark.qt_log_ignore('^load glyph failed') + @pytest.mark.qt_log_ignore('^load glyph failed', extend=True) @hypothesis.given(hypothesis.strategies.text()) def test_real_escape_hypothesis(self, webframe, qtbot, text): """Test javascript escaping with a real QWebPage and hypothesis.""" diff --git a/tests/unit/misc/test_guiprocess.py b/tests/unit/misc/test_guiprocess.py index 4e4ee162b..2bbd06191 100644 --- a/tests/unit/misc/test_guiprocess.py +++ b/tests/unit/misc/test_guiprocess.py @@ -109,7 +109,7 @@ def test_start_env(monkeypatch, qtbot, py_proc): @pytest.mark.not_frozen -@pytest.mark.qt_log_ignore('QIODevice::read.*: WriteOnly device') +@pytest.mark.qt_log_ignore('QIODevice::read.*: WriteOnly device', extend=True) def test_start_mode(proc, qtbot, py_proc): """Test simply starting a process with mode parameter.""" with qtbot.waitSignals([proc.started, proc.finished], raising=True, diff --git a/tests/unit/utils/test_error.py b/tests/unit/utils/test_error.py index 6e1133643..8cda5d1cd 100644 --- a/tests/unit/utils/test_error.py +++ b/tests/unit/utils/test_error.py @@ -74,7 +74,8 @@ def test_no_err_windows(caplog, exc, name, exc_text): # See https://github.com/The-Compiler/qutebrowser/issues/984 @pytest.mark.qt_log_ignore(r'^QXcbConnection: XCB error: 8 \(BadMatch\), ' r'sequence: \d+, resource id: \d+, major code: 42 ' - r'\(SetInputFocus\), minor code: 0$') + r'\(SetInputFocus\), minor code: 0$', + extend=True) @pytest.mark.parametrize('pre_text, post_text, expected', [ ('', '', 'exception'), ('foo', '', 'foo: exception'), diff --git a/tests/unit/utils/test_qtutils.py b/tests/unit/utils/test_qtutils.py index 32ea97e9e..8791b6779 100644 --- a/tests/unit/utils/test_qtutils.py +++ b/tests/unit/utils/test_qtutils.py @@ -338,7 +338,8 @@ class TestSerializeStream: assert src_obj == dest_obj - @pytest.mark.qt_log_ignore('^QIODevice::write.*: ReadOnly device') + @pytest.mark.qt_log_ignore('^QIODevice::write.*: ReadOnly device', + extend=True) def test_serialize_readonly_stream(self): """Test serialize_stream with a read-only stream.""" data = QByteArray() @@ -348,7 +349,8 @@ class TestSerializeStream: assert str(excinfo.value) == ("The data stream cannot write to the " "underlying device.") - @pytest.mark.qt_log_ignore('QIODevice::read.*: WriteOnly device') + @pytest.mark.qt_log_ignore('QIODevice::read.*: WriteOnly device', + extend=True) def test_deserialize_writeonly_stream(self): """Test deserialize_stream with a write-only stream.""" data = QByteArray() @@ -707,7 +709,7 @@ class TestPyQIODevice: with pytest.raises(io.UnsupportedOperation): pyqiodev.fileno() - @pytest.mark.qt_log_ignore('^QBuffer::seek: Invalid pos:') + @pytest.mark.qt_log_ignore('^QBuffer::seek: Invalid pos:', extend=True) @pytest.mark.parametrize('offset, whence, pos, data, raising', [ (0, io.SEEK_SET, 0, b'1234567890', False), (42, io.SEEK_SET, 0, b'1234567890', True),