Pytest-qt

Latest version: v4.4.0

Safety actively analyzes 618396 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

4.4.0

4.3.1

1.5.1

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](http://pyqt.sourceforge.net/Docs/PyQt5/incompatibilities.html#pyqt-v5-5) to call `abort` by default, which will crash the interpreter. (65, thanks The-Compiler).

1.5.0

- Fixed log line number in messages, and provide better contextual information in Qt5 (55, thanks The-Compiler);
- Fixed issue where exceptions inside a `waitSignals` or `waitSignal` with-statement block would be swallowed and a `SignalTimeoutError` would be raised instead. (59, thanks The-Compiler for bringing up the issue and providing a test case);
- Fixed issue where the first usage of `qapp` fixture would return `None`. Thanks to gqmelo for noticing and providing a PR;
- New `qtlog` now sports a context manager method, `disabled` (58). Thanks The-Compiler for the idea and testing;

1.4.0

- Messages sent by `qDebug`, `qWarning`, `qCritical` are captured and displayed when tests fail, similar to [pytest-catchlog](https://pypi.python.org/pypi/pytest-catchlog). Also, tests can be configured to automatically fail if an unexpected message is generated. (See [docs](http://pytest-qt.readthedocs.org/en/latest/logging.html)).
- New method `waitSignals`: will block untill **all** signals given are triggered, see [docs](http://pytest-qt.readthedocs.org/en/master/signals.html) (thanks The-Compiler for idea and complete PR).
- New parameter `raising` to `waitSignals` and `waitSignals`: when `True` (defaults to `False`) will raise a `qtbot.SignalTimeoutError` exception when timeout is reached, see [docs](http://pytest-qt.readthedocs.org/en/master/signals.html) (thanks again to The-Compiler for idea and complete PR).
- `pytest-qt` now requires `pytest` version >= 2.7.

Internal changes to improve memory management
- `QApplication.exit()` is no longer called at the end of the test session and the `QApplication` instance is not garbage collected anymore;
- `QtBot` no longer receives a QApplication as a parameter in the constructor, always referencing `QApplication.instance()` now; this avoids keeping an extra reference in the `qtbot` instances.
- `deleteLater` is called on widgets added in `QtBot.addWidget` at the end of each test;
- `QApplication.processEvents()` is called at the end of each test to make sure widgets are cleaned up;

1.3.0

pytest-qt now supports [PyQt5](http://pyqt.sourceforge.net/Docs/PyQt5/introduction.html)!

Which Qt api will be used is still detected automatically, but you can choose one using the `PYTEST_QT_API` environment variable (the old `PYTEST_QT_FORCE_PYQT` is still supported for backward compatibility).

Many thanks to jdreaver for helping to test this release!

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.