From 0a835c302e8c20964ceedae8eb5eab4dde006386 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Sun, 2 Aug 2020 22:45:16 -0400 Subject: [PATCH 1/3] Add macOS to CI --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9bfd28e3..7d154784 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: matrix: python-version: [3.6, 3.7, 3.8] qt-lib: [pyqt5, pyside2] - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-latest] include: - python-version: "3.6" tox-env: "py36" From 961f8f5e195184f6537892730d5690f120335d7c Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 15 Aug 2020 09:02:46 -0300 Subject: [PATCH 2/3] Mark flaky wait_signal tests on macOS Ref: #313 --- tests/test_wait_signal.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_wait_signal.py b/tests/test_wait_signal.py index f892d6ec..0779f463 100644 --- a/tests/test_wait_signal.py +++ b/tests/test_wait_signal.py @@ -12,6 +12,10 @@ CallbackCalledTwiceError, ) +flaky_on_macos = pytest.mark.xfail( + sys.platform == "darwin", run=False, reason="Flaky on macOS: #313" +) + def test_signal_blocker_exception(qtbot): """ @@ -81,6 +85,7 @@ def build_signal_tests_variants(params): ] ), ) +@flaky_on_macos def test_signal_triggered( qtbot, timer, @@ -228,6 +233,7 @@ def test_foo(qtbot): ] ), ) +@flaky_on_macos def test_signal_triggered_multiple( qtbot, timer, From f5fafbcd95f53c92b94386bf555aa89ec81a1185 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 15 Aug 2020 09:03:40 -0300 Subject: [PATCH 3/3] Remove obsolete test --- tests/test_wait_signal.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/tests/test_wait_signal.py b/tests/test_wait_signal.py index 0779f463..40777694 100644 --- a/tests/test_wait_signal.py +++ b/tests/test_wait_signal.py @@ -1006,43 +1006,6 @@ def test_without_callback_and_args(self, qtbot, signaller): ex_msg = TestWaitSignalsTimeoutErrorMessage.get_exception_message(excinfo) assert ex_msg == "Signal signal() not emitted after 200 ms" - def test_unable_to_get_callback_name(self, qtbot, signaller): - """ - Test that for complicated callbacks which aren't callables, but e.g. double-wrapped partials, the test code - is sometimes unable to determine the name of the callback. - Note that this behavior changes with Python 3.5, where a functools.partial() is smart enough to detect wrapped - calls. - """ - if sys.version_info >= (3, 5): - pytest.skip( - "Only on Python 3.4 and lower double-wrapped functools.partial callbacks are a problem" - ) - - if qt_api.pytest_qt_api == "pyside2": - signal = (signaller.signal_single_arg, "signal_single_arg(int)") - else: - signal = signaller.signal_single_arg - - def callback(int_param, unused_param1, unused_param2): - return int_param == 1337 - - wrapped_callback = functools.partial(callback, unused_param2=1) - double_wrapped_callback = functools.partial(wrapped_callback, unused_param1=1) - - with pytest.raises(TimeoutError) as excinfo: - with qtbot.waitSignal( - signal=signal, - timeout=200, - raising=True, - check_params_cb=double_wrapped_callback, - ): - signaller.signal_single_arg.emit(1) - ex_msg = TestWaitSignalsTimeoutErrorMessage.get_exception_message(excinfo) - assert ex_msg == ( - "Signal signal_single_arg(int) emitted with parameters [1] within 200 ms, " - "but did not satisfy the callback" - ) - def test_with_single_arg(self, qtbot, signaller): """ In a situation where a signal with one argument is expected but the emitted instances have values that are