Skip to content Skip to sidebar Skip to footer

Why A Fatal Python Error When Testing Using Pytest-qt?

My first test using pytest-qt failed immediately with a Fatal Python error. I reduced the code to this (a test that would never pass, but shouldn't crash): from PyQt5 import QtCor

Solution 1:

Unsurprisingly, there is a configuration issue with the Qt5.12 libraries simply being copied into a folder. I was able to craft a workaround as follows:

sudo mkdir /usr/bin/platforms
sudo ln -s /our/local/libqxcb.so /usr/bin/platforms/libqxcb.so

This was sufficient for me to run my tests without this crash.

As Florian at the pytest-qt site advised me, this Python:

from PyQt5.QtWidgets importQApplicationapp= QApplication([])

also fails, but without much information. Then I got a tip to

export QT_DEBUG_PLUGINS=1

and the extra diagnostic info pointed me to that platforms folder.

Post a Comment for "Why A Fatal Python Error When Testing Using Pytest-qt?"