Releases: pytest-dev/pytest-qt
Releases · pytest-dev/pytest-qt
4.5.0
4.4.0
Release 4.4.0 Simplify the pytest requirement because due to our own python requirement (3.8+), the pytest requirement is met.
4.3.1
Use an environment for deploy
Capturing exceptions during test tear down
Exceptions are now captured also during test tear down, as delayed events will get processed then and might raise exceptions in virtual methods; this is specially problematic in PyQt5.5, which changed the behavior to call abort by default, which will crash the interpreter. (#65, thanks @The-Compiler).
qtlog.disabled() and some bug fixes
- Fixed log line number in messages, and provide better contextual information in Qt5 (#55, thanks @The-Compiler);
- Fixed issue where exceptions inside a waitSignalsorwaitSignalwith-statement block would be swallowed and aSignalTimeoutErrorwould be raised instead. (#59, thanks @The-Compiler for bringing up the issue and providing a test case);
- Fixed issue where the first usage of qappfixture would returnNone. Thanks to @gqmelo for noticing and providing a PR;
- New qtlognow sports a context manager method,disabled(#58). Thanks @The-Compiler for the idea and testing;
Qt Logging, waitSignals
- Messages sent by qDebug,qWarning,qCriticalare captured and displayed when tests fail, similar to pytest-catchlog. Also, tests can be configured to automatically fail if an unexpected message is generated. (See docs).
- New method waitSignals: will block untill all signals given are triggered, see docs (thanks @The-Compiler for idea and complete PR).
- New parameter raisingtowaitSignalsandwaitSignals: whenTrue(defaults toFalse) will raise aqtbot.SignalTimeoutErrorexception when timeout is reached, see docs (thanks again to @The-Compiler for idea and complete PR).
- pytest-qtnow requires- pytestversion >= 2.7.
Internal changes to improve memory management
- QApplication.exit()is no longer called at the end of the test session and the- QApplicationinstance is not garbage collected anymore;
- QtBotno longer receives a QApplication as a parameter in the constructor, always referencing- QApplication.instance()now; this avoids keeping an extra reference in the- qtbotinstances.
- deleteLateris called on widgets added in- QtBot.addWidgetat the end of each test;
- QApplication.processEvents()is called at the end of each test to make sure widgets are cleaned up;
PyQt5 support
PyQt: no longer setting API version
Now the module qt_compat no longer sets QString and QVariant apis to 2 for PyQt, making it compatible for those still using version 1 of the API.
Small improvements
- Now it is possible to disable automatic exception capture by using markers or a pytest.inioption. Consult the documentation for more information. (#26, thanks @datalyze-solutions for bringing this up)
- QApplicationinstance is created only if it wasn't created yet (#21, thanks @fabioz!)
- addWidgetnow keeps a weak reference its widgets (#20, thanks @fabioz)