@@ -26,7 +26,8 @@ def print_msg(msg_type, context, message):
2626 qt_api.QtCore.qInstallMessageHandler(print_msg)
2727
2828 def test_types():
29- qt_api.qInfo('this is an INFO message')
29+ # qInfo is not exposed by the bindings yet (#225)
30+ # qt_api.qInfo('this is an INFO message')
3031 qt_api.qDebug('this is a DEBUG message')
3132 qt_api.qWarning('this is a WARNING message')
3233 qt_api.qCritical('this is a CRITICAL message')
@@ -44,7 +45,8 @@ def test_types():
4445 res .stdout .fnmatch_lines (
4546 [
4647 "*-- Captured Qt messages --*" ,
47- "*QtInfoMsg: this is an INFO message*" ,
48+ # qInfo is not exposed by the bindings yet (#232)
49+ # '*QtInfoMsg: this is an INFO message*',
4850 "*QtDebugMsg: this is a DEBUG message*" ,
4951 "*QtWarningMsg: this is a WARNING message*" ,
5052 "*QtCriticalMsg: this is a CRITICAL message*" ,
@@ -54,25 +56,43 @@ def test_types():
5456 res .stdout .fnmatch_lines (
5557 [
5658 "*-- Captured stderr call --*" ,
57- "this is an INFO message*" ,
59+ # qInfo is not exposed by the bindings yet (#232)
60+ # '*QtInfoMsg: this is an INFO message*',
61+ # 'this is an INFO message*',
5862 "this is a DEBUG message*" ,
5963 "this is a WARNING message*" ,
6064 "this is a CRITICAL message*" ,
6165 ]
6266 )
6367
6468
69+ def test_qinfo (qtlog ):
70+ """Test INFO messages when we have means to do so. Should be temporary until bindings
71+ catch up and expose qInfo (or at least QMessageLogger), then we should update
72+ the other logging tests properly. #232
73+ """
74+
75+ if qt_api .is_pyside :
76+ assert (
77+ qt_api .qInfo is None
78+ ), "pyside6 does not expose qInfo. If it does, update this test."
79+ return
80+
81+ qt_api .qInfo ("this is an INFO message" )
82+ records = [(m .type , m .message .strip ()) for m in qtlog .records ]
83+ assert records == [(qt_api .QtCore .QtMsgType .QtInfoMsg , "this is an INFO message" )]
84+
85+
6586def test_qtlog_fixture (qtlog ):
6687 """
6788 Test qtlog fixture.
6889 """
69- qt_api . qInfo ( "this is an INFO message" )
90+ # qInfo is not exposed by the bindings yet (#232 )
7091 qt_api .qDebug ("this is a DEBUG message" )
7192 qt_api .qWarning ("this is a WARNING message" )
7293 qt_api .qCritical ("this is a CRITICAL message" )
7394 records = [(m .type , m .message .strip ()) for m in qtlog .records ]
7495 assert records == [
75- (qt_api .QtCore .QtMsgType .QtInfoMsg , "this is an INFO message" ),
7696 (qt_api .QtCore .QtMsgType .QtDebugMsg , "this is a DEBUG message" ),
7797 (qt_api .QtCore .QtMsgType .QtWarningMsg , "this is a WARNING message" ),
7898 (qt_api .QtCore .QtMsgType .QtCriticalMsg , "this is a CRITICAL message" ),
0 commit comments