pytest-qt icon indicating copy to clipboard operation
pytest-qt copied to clipboard

filterwarnings does not seem to work

Open The-Compiler opened this issue 3 years ago • 1 comments

In tests/test_wait_signal.py, we have:

@pytest.mark.filterwarnings("ignore:qt_wait_signal_raising is deprecated")
@pytest.mark.parametrize("configkey", ["qt_wait_signal_raising", "qt_default_raising"])
def test_raising_by_default_overridden(qtbot, testdir, configkey):

yet running pytest results in:


=============================== warnings summary ===============================
tests/test_wait_signal.py::test_raising_by_default_overridden[qt_wait_signal_raising]
  /home/florian/proj/pytest-qt/.tox/py37-pyside6/lib/python3.7/site-packages/pytestqt/plugin.py:226: DeprecationWarning: qt_wait_signal_raising is deprecated, use qt_default_raising instead.
    DeprecationWarning,

-- Docs: https://docs.pytest.org/en/stable/warnings.html
================== 206 passed, 3 skipped, 1 warning in 23.79s ==================

any idea why? I'm stumped...

The-Compiler avatar Mar 16 '21 11:03 The-Compiler

Sorry for the delay.

I suspect this is because some early warnings cannot really be ignored by pytest's filterwarnings configuration (because they are not captured). I will see if I can investigate this when I have some time to give a definitive answer.

nicoddemus avatar Mar 26 '21 18:03 nicoddemus