pytest-qt

travis with pytest-qt fails without exiting nor creating QmessageBox

▼魔方 西西 提交于 2021-02-17 03:57:52
问题 The context I try to create an integration test for an graphical user interface (GUI) written with Qt5 through python3 (so using pyqt5 ). And I use pytest with the plugging pytest-qt to test the GUI. I test the GUI which here is largely inspired from this question, so the command pytest -v -s runs well. Since my repository is on Github , I use Travis-CI to perform my integration tests. The error However when I push on Github and so I launch the Travis tests I get at some point the following

How to handle modal dialog in pytest-qt without mocking the dialog

空扰寡人 提交于 2021-01-29 07:30:47
问题 I am using pytest-qt to automate the testing of a PyQt GUI. The dialogs need to be handled as a part of the testing(dialogs should not be mocked). For example, file dialog that comes after a button-click has to be handled. There are 2 problems After the button click command, the program control goes to the event handler and not to the next line where I can try to send mouseclick/keystrokes to the dialog. Since the QDialog is not added to the main widget, it is not being listed among the

Why a Fatal Python error when testing using pytest-qt?

五迷三道 提交于 2021-01-05 08:53:16
问题 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 QtCore as qtc class sut(qtc.QObject): sig_sig_sputnik = qtc.pyqtSignal() def __init__(self): super().__init__() def listen(self): pass def test_emit(qtbot): uut = sut() with qtbot.waitSignal(sut.sig_sig_sputnik, raising=True): uut.listen() Executing this fails with: === test session starts ==== platform linux -- Python 3

Fatal Python Error when running pytest with QT

女生的网名这么多〃 提交于 2020-12-13 05:02:50
问题 I'm new to pytest and I'm having trouble trying to run one of my test files. I'm getting the following output: ================================================== test session starts ================================================== platform linux -- Python 3.7.6, pytest-5.3.5, py-1.8.1, pluggy-0.13.1 -- /home/jarel/anaconda3/bin/python cachedir: .pytest_cache hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/jarel/workspace/spyder/rpgland/.hypothesis/examples')

QApplication instance/qtbot fixture causes travis-ci to abort and core dump

你说的曾经没有我的故事 提交于 2020-04-13 16:52:31
问题 Working on understanding how to go about automated unit testing for PySide2-based applications. However, whenever I attempt to initialize a QApplication instance within the tests, be it through PySide2 itself or through pytest-qt 's qtbot fixture, travis-ci aborts the test. It works locally, however. I've attempted using the qtbot and qapp fixtures from pytest-qt , trying different travis-ci distros like xenial and trusty , as well as including the pytest-xvfb plugin as I've seen recommended

QApplication instance/qtbot fixture causes travis-ci to abort and core dump

你离开我真会死。 提交于 2020-04-13 16:51:28
问题 Working on understanding how to go about automated unit testing for PySide2-based applications. However, whenever I attempt to initialize a QApplication instance within the tests, be it through PySide2 itself or through pytest-qt 's qtbot fixture, travis-ci aborts the test. It works locally, however. I've attempted using the qtbot and qapp fixtures from pytest-qt , trying different travis-ci distros like xenial and trusty , as well as including the pytest-xvfb plugin as I've seen recommended

How to click on QMessageBox with pytest-qt?

ⅰ亾dé卋堺 提交于 2020-01-15 10:14:45
问题 I am creating some unit tests for a PyQt application with pytest-qt . And I would like to create open the graphical window, do some tests then close the window, rather than open a new window for every test, ie. use a module fixture for the window itself. I succeeded to do this part, by calling in a local function a QtBot rather than using the default fixture, and removing the mocker ones. So I am pretty close to my objective. However, but I am not able to close the window (and test the

Running pytest-qt on CircleCI

左心房为你撑大大i 提交于 2019-12-11 02:09:48
问题 I am attempting to run tests which require pytest-qt (for testing PySide2 dialogs) on CircleCI. I am getting the following error: xdpyinfo was not found, X start can not be checked! Please install xdpyinfo! ============================= test session starts ============================== platform linux -- Python 3.6.8, pytest-5.0.0, py-1.8.0, pluggy-0.12.0 -- /home/circleci/project-caveman/venv/bin/python3 cachedir: .pytest_cache PySide2 5.13.0 -- Qt runtime 5.13.0 -- Qt compiled 5.13.0