Package: python3-pyside6.qtcore
Version: 6.9.2-2+b1
Severity: important

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:

```
% cat test.py
def test_foo(): pass

% python3 -Is -m pytest test.py
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/lib/python3/dist-packages/_pytest/main.py", line 314, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>     ~~~~~~~~~~~~~~~~~~~~^^
INTERNALERROR> File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 1159, in _do_configure INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) INTERNALERROR> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 534, in call_historic INTERNALERROR> res = self._hookexec(self.name, self._hookimpls.copy(), kwargs, False) INTERNALERROR> File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) INTERNALERROR> ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 167, in _multicall
INTERNALERROR>     raise exception
INTERNALERROR> File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 121, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR> File "/usr/lib/python3/dist-packages/pytestqt/plugin.py", line 243, in pytest_configure
INTERNALERROR>     qt_api.set_qt_api(config.getini("qt_api"))
INTERNALERROR>     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/usr/lib/python3/dist-packages/pytestqt/qt_compat.py", line 110, in set_qt_api
INTERNALERROR>     self.QtTest = _import_module("QtTest")
INTERNALERROR>                   ~~~~~~~~~~~~~~^^^^^^^^^^
INTERNALERROR> File "/usr/lib/python3/dist-packages/pytestqt/qt_compat.py", line 106, in _import_module
INTERNALERROR>     return getattr(m, module_name)
INTERNALERROR> File "/usr/lib/python3/dist-packages/PySide6/__init__.py", line 127, in __getattr__ INTERNALERROR> raise AttributeError(f"module '{__name__}' has no attribute '{name}' :)")
INTERNALERROR> AttributeError: module 'PySide6' has no attribute 'QtTest' :)
```

I'm running debian's stock python in isolated mode (so no virtual env, no PYTHONPATH, no user libs, only stuff from debian packages), and a test not even using qt/pyqt/pyside simply cannot run. 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.

Reply via email to