@@ -50,7 +50,7 @@ def test_types():
50
50
res .stdout .fnmatch_lines (
51
51
[
52
52
"*-- Captured Qt messages --*" ,
53
- # qInfo is not exposed by the bindings yet (#225 )
53
+ # qInfo is not exposed by the bindings yet (#232 )
54
54
# '*QtInfoMsg: this is an INFO message*',
55
55
"*QtDebugMsg: this is a DEBUG message*" ,
56
56
"*QtWarningMsg: this is a WARNING message*" ,
@@ -61,7 +61,7 @@ def test_types():
61
61
res .stdout .fnmatch_lines (
62
62
[
63
63
"*-- Captured stderr call --*" ,
64
- # qInfo is not exposed by the bindings yet (#225 )
64
+ # qInfo is not exposed by the bindings yet (#232 )
65
65
# '*QtInfoMsg: this is an INFO message*',
66
66
# 'this is an INFO message*',
67
67
"this is a DEBUG message*" ,
@@ -71,11 +71,30 @@ def test_types():
71
71
)
72
72
73
73
74
+ def test_qinfo (qtlog ):
75
+ """Test INFO messages when we have means to do so. Should be temporary until bindings
76
+ catch up and expose qInfo (or at least QMessageLogger), then we should update
77
+ the other logging tests properly. #232
78
+ """
79
+ if qt_api .pytest_qt_api .startswith ("pyside" ):
80
+ assert (
81
+ qt_api .qInfo is None
82
+ ), "pyside does not expose qInfo. If it does, update this test."
83
+ return
84
+
85
+ if qt_api .pytest_qt_api .startswith ("pyqt4" ):
86
+ pytest .skip ("qInfo and QtInfoMsg not supported in PyQt 4" )
87
+
88
+ qt_api .qInfo ("this is an INFO message" )
89
+ records = [(m .type , m .message .strip ()) for m in qtlog .records ]
90
+ assert records == [(qt_api .QtInfoMsg , "this is an INFO message" )]
91
+
92
+
74
93
def test_qtlog_fixture (qtlog ):
75
94
"""
76
95
Test qtlog fixture.
77
96
"""
78
- # qInfo is not exposed by the bindings yet (#225 )
97
+ # qInfo is not exposed by the bindings yet (#232 )
79
98
qt_api .qDebug ("this is a DEBUG message" )
80
99
qt_api .qWarning ("this is a WARNING message" )
81
100
qt_api .qCritical ("this is a CRITICAL message" )
0 commit comments