@@ -26,7 +26,8 @@ def print_msg(msg_type, context, message):
26
26
qt_api.QtCore.qInstallMessageHandler(print_msg)
27
27
28
28
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')
30
31
qt_api.qDebug('this is a DEBUG message')
31
32
qt_api.qWarning('this is a WARNING message')
32
33
qt_api.qCritical('this is a CRITICAL message')
@@ -44,7 +45,8 @@ def test_types():
44
45
res .stdout .fnmatch_lines (
45
46
[
46
47
"*-- 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*',
48
50
"*QtDebugMsg: this is a DEBUG message*" ,
49
51
"*QtWarningMsg: this is a WARNING message*" ,
50
52
"*QtCriticalMsg: this is a CRITICAL message*" ,
@@ -54,25 +56,43 @@ def test_types():
54
56
res .stdout .fnmatch_lines (
55
57
[
56
58
"*-- 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*',
58
62
"this is a DEBUG message*" ,
59
63
"this is a WARNING message*" ,
60
64
"this is a CRITICAL message*" ,
61
65
]
62
66
)
63
67
64
68
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
+
65
86
def test_qtlog_fixture (qtlog ):
66
87
"""
67
88
Test qtlog fixture.
68
89
"""
69
- qt_api . qInfo ( "this is an INFO message" )
90
+ # qInfo is not exposed by the bindings yet (#232 )
70
91
qt_api .qDebug ("this is a DEBUG message" )
71
92
qt_api .qWarning ("this is a WARNING message" )
72
93
qt_api .qCritical ("this is a CRITICAL message" )
73
94
records = [(m .type , m .message .strip ()) for m in qtlog .records ]
74
95
assert records == [
75
- (qt_api .QtCore .QtMsgType .QtInfoMsg , "this is an INFO message" ),
76
96
(qt_api .QtCore .QtMsgType .QtDebugMsg , "this is a DEBUG message" ),
77
97
(qt_api .QtCore .QtMsgType .QtWarningMsg , "this is a WARNING message" ),
78
98
(qt_api .QtCore .QtMsgType .QtCriticalMsg , "this is a CRITICAL message" ),
0 commit comments