Releases: pytest-dev/pytest-qt
Releases · pytest-dev/pytest-qt
waitSignal support added
This version include the new waitSignal
function, which makes it easy to write tests for long running computations that happen in other threads or processes:
def test_long_computation(qtbot):
app = Application()
# Watch for the app.worker.finished signal, then start the worker.
with qtbot.waitSignal(app.worker.finished, timeout=10000) as blocker:
blocker.connect(app.worker.failed) # Can add other signals to blocker
app.worker.start()
# Test will wait here until either signal is emitted, or 10 seconds has elapsed
assert blocker.signal_triggered # Assuming the work took less than 10 seconds
assert_application_results(app)
Many thanks to @jdreaver for discussion and complete PR! (#12, #13)
Catching exceptions in Qt virtual methods
- Added
stop
as an alias forstopForInteraction
(#10, thanks @itghisi) - Now exceptions raised in virtual methods make tests fail, instead of silently passing (#11). If an exception is raised, the test will fail and it exceptions that happened inside virtual calls will be printed as such:
E Failed: Qt exceptions in virtual methods:
E ________________________________________________________________________________
E File "x:\pytest-qt\pytestqt\_tests\test_exceptions.py", line 14, in event
E raise ValueError('mistakes were made')
E
E ValueError: mistakes were made
E ________________________________________________________________________________
E File "x:\pytest-qt\pytestqt\_tests\test_exceptions.py", line 14, in event
E raise ValueError('mistakes were made')
E
E ValueError: mistakes were made
E ________________________________________________________________________________
Thanks to @jdreaver for request and sample code!
- Fixed documentation for
QtBot
: it was not being rendered in the docs due to an import error.
Python 3 support
This release adds support for Python 3+.
Minor documentation fixes
This is just a minor release with some documentation improvements.
Small bug fix release
1.0.1 Fixed setup.py to include distribute_setup in sdist
First working version
1.0.0 Bumping version to 1.0