Hi again

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.


$ echo "def test_foo(): pass" > test_foo.py
$ pytest
============================================== test session starts ==============================================
platform linux -- Python 3.13.11, pytest-8.4.2, pluggy-1.6.0
PySide6 6.9.2 -- Qt runtime 6.9.2 -- Qt compiled 6.9.2
rootdir: /tmp/pkgs
plugins: anyio-4.11.0, typeguard-4.4.4, qt-4.4.0, cov-5.0.0, zarr-3.1.5, hypothesis-6.151.4, mock-3.15.1, syrupy-5.0.0, subtests-0.15.0 collected 1 item

test_foo.py . [100%]

=============================================== 1 passed in 0.09s ===============================================


As I said in my initial reply, this is due to pytestqt's somewhat imperfect Qt API detection and it is there that you need to look for a solution.

The pytestqt docs I linked to offer the following options as workarounds for you right now:

- tell pytestqt to use an API other than PySide6, e.g. by setting
  PYTEST_QT_API=pyqt5
- tell pytest not to load plugins by setting
  PYTEST_DISABLE_PLUGIN_AUTOLOAD=1

or alternatively you could, as a workaround:

- install the python3-pyside6.qttest package as well
- uninstall the python3-pytestqt package (nothing in Debian requires
  it at runtime)

The longer term fix to pytestqt is likely what Rebecca Palmer noted in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1125222#24

Stuart


--
Stuart Prescott   http://www.nanonanonano.net/ [email protected]
Debian Developer  http://www.debian.org/       [email protected]
GPG fingerprint   90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7

Reply via email to