Skip to content

Commit 3f7dd89

Browse files
committed
Merge branch 'master' into qt-api-ini
2 parents e160714 + dfb32bc commit 3f7dd89

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

CHANGELOG.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,20 @@ New Features
4040
is met or a timeout is reached. Useful for testing asynchronous features
4141
(like in X window environments for example).
4242

43-
* Now which Qt binding ``pytest-qt`` should use can be configured by the ``qt_api`` config option.
43+
* ``waitSignal`` and ``waitSignals`` can receive an optional callback that can
44+
evaluate if the arguments of emitted signals should resume execution or not.
45+
Thanks `@MShekow`_ for the PR (`#141`_).
46+
47+
* Now which Qt binding ``pytest-qt`` will use can be configured by the ``qt_api`` config option.
4448
Thanks `@The-Compiler`_ for the request (`#129`_).
4549

46-
- While ``pytestqt.qt_compat`` is an internal module and shouldn't be imported directly,
50+
* While ``pytestqt.qt_compat`` is an internal module and shouldn't be imported directly,
4751
it is known that some test suites did import it. This module now uses a lazy-load mechanism
4852
to load Qt classes and objects, so the old symbols (``QtCore``, ``QApplication``, etc.) are
4953
no longer available from it.
5054

5155
.. _#134: https://github.com/pytest-dev/pytest-qt/issues/134
56+
.. _#141: https://github.com/pytest-dev/pytest-qt/pull/141
5257
.. _#63: https://github.com/pytest-dev/pytest-qt/pull/63
5358
.. _#129: https://github.com/pytest-dev/pytest-qt/issues/129
5459

@@ -369,13 +374,14 @@ Small bug fix release.
369374
First working version.
370375

371376

372-
.. _@The-Compiler: https://github.com/The-Compiler
373-
.. _@montefra: https://github.com/montefra
374-
.. _@gqmelo: https://github.com/gqmelo
375-
.. _@jdreaver: https://github.com/jdreaver
377+
.. _@baudren: https://github.com/baudren
378+
.. _@billyshambrook: https://github.com/billyshambrook
376379
.. _@datalyze-solutions: https://github.com/datalyze-solutions
377380
.. _@fabioz: https://github.com/fabioz
378-
.. _@baudren: https://github.com/baudren
381+
.. _@gqmelo: https://github.com/gqmelo
379382
.. _@itghisi: https://github.com/itghisi
383+
.. _@jdreaver: https://github.com/jdreaver
384+
.. _@montefra: https://github.com/montefra
385+
.. _@MShekow: https://github.com/MShekow
380386
.. _@Sheeo: https://github.com/Sheeo
381-
.. _@billyshambrook: https://github.com/billyshambrook
387+
.. _@The-Compiler: https://github.com/The-Compiler

pytestqt/qtbot.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,18 @@ def waitSignal(self, signal=None, timeout=1000, raising=None, check_params_cb=No
225225
This defaults to ``True`` unless ``qt_wait_signal_raising = false``
226226
is set in the config.
227227
:param Callable check_params_cb:
228-
Optional callable(*parameters) that compares the provided signal parameters to some expected parameters.
228+
Optional ``callable(*parameters)`` that compares the provided signal parameters to some expected parameters.
229229
It has to match the signature of ``signal`` (just like a slot function would) and return ``True`` if
230230
parameters match, ``False`` otherwise.
231231
:returns:
232232
``SignalBlocker`` object. Call ``SignalBlocker.wait()`` to wait.
233233
234234
.. note::
235-
Cannot have both ``signals`` and ``timeout`` equal ``None``, or
236-
else you will block indefinitely. We throw an error if this occurs.
235+
Cannot have both ``signals`` and ``timeout`` equal ``None``, or
236+
else you will block indefinitely. We throw an error if this occurs.
237237
238-
.. note:: This method is also available as ``wait_signal`` (pep-8 alias)
238+
.. note::
239+
This method is also available as ``wait_signal`` (pep-8 alias)
239240
"""
240241
if raising is None:
241242
raising_val = self._request.config.getini('qt_wait_signal_raising')
@@ -289,12 +290,16 @@ def waitSignals(self, signals=None, timeout=1000, raising=None, check_params_cbs
289290
Instead of a specific callable, ``None`` can be provided, to disable parameter checking for the
290291
corresponding signal.
291292
If the number of callbacks doesn't match the number of signals ``ValueError`` will be raised.
292-
:param str order: determines the order in which to expect signals
293-
* ``"none"``: no order is enforced
294-
* ``"strict"``: signals have to be emitted strictly in the provided order
295-
(e.g. fails when expecting signals [a, b] and [a, a, b] is emitted)
296-
* ``"simple"``: like "strict", but signals may be emitted in-between the provided ones, e.g. expected
297-
``signals`` == [a, b, c] and actually emitted signals = [a, a, b, a, c] works (would fail with "strict")
293+
:param str order:
294+
Determines the order in which to expect signals:
295+
296+
- ``"none"``: no order is enforced
297+
- ``"strict"``: signals have to be emitted strictly in the provided order
298+
(e.g. fails when expecting signals [a, b] and [a, a, b] is emitted)
299+
- ``"simple"``: like "strict", but signals may be emitted in-between the provided ones, e.g. expected
300+
``signals == [a, b, c]`` and actually emitted ``signals = [a, a, b, a, c]`` works
301+
(would fail with ``"strict"``).
302+
298303
:returns:
299304
``MultiSignalBlocker`` object. Call ``MultiSignalBlocker.wait()``
300305
to wait.

0 commit comments

Comments
 (0)