Skip to content

Commit 1184fbf

Browse files
committed
Add multiple parameter test for qt_log_ignore mark
1 parent 7ca57d7 commit 1184fbf

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

pytestqt/_tests/test_logging.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,29 @@ def test1():
265265
res = testdir.inline_run()
266266
passed = 1 if mark_regex == 'WM_DESTROY.*sent' else 0
267267
res.assertoutcome(passed=passed, failed=int(not passed))
268+
269+
270+
@pytest.mark.parametrize('apply_mark', [True, False])
271+
def test_logging_fails_ignore_mark_multiple(testdir, apply_mark):
272+
"""
273+
Make sure qt_log_ignore mark supports multiple arguments.
274+
275+
:type testdir: _pytest.pytester.TmpTestdir
276+
"""
277+
if apply_mark:
278+
mark = '@pytest.mark.qt_log_ignore("WM_DESTROY", "WM_PAINT")'
279+
else:
280+
mark = ''
281+
testdir.makepyfile(
282+
"""
283+
from pytestqt.qt_compat import qWarning, qCritical
284+
import pytest
285+
@pytest.mark.qt_log_level_fail('CRITICAL')
286+
{mark}
287+
def test1():
288+
qCritical('WM_PAINT was sent')
289+
""".format(mark=mark)
290+
)
291+
res = testdir.inline_run()
292+
passed = 1 if apply_mark else 0
293+
res.assertoutcome(passed=passed, failed=int(not passed))

0 commit comments

Comments
 (0)