-
-
Notifications
You must be signed in to change notification settings - Fork 71
Fetch signal names from PySide6 signal instances #648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -905,7 +905,7 @@ def test_empty_when_no_signal(self, qtbot, signaller): | |
| pass | ||
| assert blocker.all_signals_and_args == [] | ||
|
|
||
| def test_empty_when_no_signal_name_available(self, qtbot, signaller): | ||
| def test_non_empty_on_pyside(self, qtbot, signaller): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docstring and the However, if we can adjust |
||
| """ | ||
| Tests that all_signals_and_args is empty even though expected signals are emitted, but signal names aren't | ||
| available. | ||
|
|
@@ -924,7 +924,7 @@ def test_empty_when_no_signal_name_available(self, qtbot, signaller): | |
| ) as blocker: | ||
| signaller.signal.emit() | ||
| signaller.signal_args.emit("1", 1) | ||
| assert blocker.all_signals_and_args == [] | ||
| assert len(blocker.all_signals_and_args) == 2 | ||
|
|
||
| def test_non_empty_on_timeout_no_cb(self, qtbot, signaller): | ||
| """ | ||
|
|
@@ -1188,16 +1188,13 @@ def test_strict_order_violation(self, qtbot, signaller): | |
| "Missing: [signal(), signal_args(QString,int), signal_args(QString,int)]" | ||
| ).format(signal_args, signal_args) | ||
|
|
||
| def test_degenerate_error_msg(self, qtbot, signaller): | ||
| def test_error_msg_on_pyside(self, qtbot, signaller): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above, when adjusting (or removing) |
||
| """ | ||
| Tests that the TimeoutError message is degenerate when using PySide6 signals for which no name is provided | ||
| by the user. This degenerate messages doesn't contain the signals' names, and includes a hint to the user how | ||
| to fix the situation. | ||
| Tests that the TimeoutError message is not degenerate when using PySide6 signals, since now | ||
| we can fetch the signal name in PySide6. The error message should provide the signal names. | ||
| """ | ||
| if qt_api.pytest_qt_api != "pyside6": | ||
| pytest.skip( | ||
| "test only makes sense for PySide, whose signals don't contain a name" | ||
| ) | ||
| pytest.skip("test only makes sense for PySide") | ||
|
|
||
| with pytest.raises(TimeoutError) as excinfo: | ||
| with qtbot.waitSignals( | ||
|
|
@@ -1214,9 +1211,7 @@ def test_degenerate_error_msg(self, qtbot, signaller): | |
| signaller.signal.emit() | ||
| ex_msg = TestWaitSignalsTimeoutErrorMessage.get_exception_message(excinfo) | ||
| assert ex_msg == ( | ||
| "Received 1 of the 3 expected signals. " | ||
| "To improve this error message, provide the names of the signals " | ||
| "in the waitSignals() call." | ||
| "Emitted signals: [signal]. Missing: [signal_args, signal_args]" | ||
| ) | ||
|
|
||
| def test_self_defined_signal_name(self, qtbot, signaller): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, on PyQt (both 5 and 6), I get
AttributeError: type object 'QMetaMethod' has no attribute 'fromSignal', so it looks like the split between PyQt/PySide is still needed.