Skip to content

Releases: pytest-dev/pytest-qt

waitSignal support added

03 Jul 00:53
Compare
Choose a tag to compare

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

31 May 22:10
Compare
Choose a tag to compare
  • Added stop as an alias for stopForInteraction (#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

14 May 01:16
Compare
Choose a tag to compare

This release adds support for Python 3+.

Minor documentation fixes

10 Sep 03:34
Compare
Choose a tag to compare

This is just a minor release with some documentation improvements.

Small bug fix release

10 Sep 03:45
Compare
Choose a tag to compare
1.0.1

Fixed setup.py to include distribute_setup in sdist

First working version

10 Sep 03:45
Compare
Choose a tag to compare
1.0.0

Bumping version to 1.0