Le 05/02/2026 à 13:03, Stuart Prescott a écrit :
I have python3-pytestqt for testing some PyQt programs (also it's a dependency of some debian packages). However, merely installing pyside (because it's a dependency of some debian packages) breaks *ALL* pytest uses as long as python3-pytestqt is installed:

It doesn't break *ALL*, but it will certainly break anything that requires PyQt5, PyQt6 or PySide2 and has not declared that.

That's because pytestqt tries to do some autodetection of which Python Qt API to use and this detection is somewhere between fragile and buggy.


It seems by default all pytest plugins are run, and the pyside package hijacks something that the pytestqt plugin expects.
Please make pyside be a good citizen and not intercept pyqt imports.

No hijacking involved, just that the tests you are running have not specified which Qt API they should be run against (they should, see the pytestqt docs [1]), and the pytestqt detection of the Python Qt API is flawed.

[1]  https://pytest-qt.readthedocs.io/en/latest/intro.html#requirements

There is absolutely nothing that PySide6 packaging can do about this.


I insist, all pytest usage breaks: as you can (re-)read in my previous message, the test file doesn't use any import at all, just:

def test_foo(): pass

in a file and pytest breaks.

Reply via email to