Skip to content

Commit 6e90e17

Browse files
committed
Strip spaces after the end of message on tests
PyQt4 and PySide differ on this aspect, it seems
1 parent 465cbf2 commit 6e90e17

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pytestqt/_tests/test_logging.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ def test_qtlog_fixture(qtlog):
5555
qDebug('this is a DEBUG message')
5656
qWarning('this is a WARNING message')
5757
qCritical('this is a CRITICAL message')
58-
# note that in the messages below, we have an extra space at the end
59-
# added by Qt
60-
messages = [(int(m.msg_type), m.msg) for m in qtlog.messages]
58+
messages = [(m.msg_type, m.msg.strip()) for m in qtlog.messages]
6159
assert messages == [
62-
(int(QtDebugMsg), 'this is a DEBUG message '),
63-
(int(QtWarningMsg), 'this is a WARNING message '),
64-
(int(QtCriticalMsg), 'this is a CRITICAL message '),
60+
(QtDebugMsg, 'this is a DEBUG message'),
61+
(QtWarningMsg, 'this is a WARNING message'),
62+
(QtCriticalMsg, 'this is a CRITICAL message'),
6563
]
6664
# `messages` attribute is read-only
6765
with pytest.raises(AttributeError):

0 commit comments

Comments
 (0)