To test my code that is a plugin for a pyqt5 application, I'm writing tests that create dummy QApplication objects.
However, whenever I try to create a QApplication code locally works as expected but segfaults in travis.
I pinpointed the issue to the following line:
qapp = QtWidgets.QApplication([])
This is the error I'm getting (taken from the travis log):
tests/idaplugin/test_plugin.py::test_plugin_creation /home/travis/.travis/job_stages: line 53: 2382 Aborted (core dumped) PYTHONPATH=. py.test ./${PROJECT} ./tests/${PROJECT} --verbose --cov-report= --cov=$PROJECT
Here is the travis-ci job: https://travis-ci.org/nirizr/rematch/jobs/219490893
And here's the snippet of the test:
def test_plugin_creation():
from PyQt5 import QtWidgets
qapp = QtWidgets.QApplication([])
# test be here, requires a QApp to function
plugin = plugin_rematch.PLUGIN_ENTRY()
... extra test code removed ...
Is this an issue with travis or am I doing something wrong?