Skip to content
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

[FIX] Fix asynchronous widget tests #2520

Merged
merged 5 commits into from
Aug 9, 2017

Conversation

ales-erjavec
Copy link
Contributor

Issue

Asynchronous tests for owmds and owtestlearners set inputs to their respective widgets when they should not (a per OWWidget.isBlocking).

Description of changes
  • Raise RuntimeError in WidgetTest.send_signal if the target widget is not ready to receive inputs.
  • Add wait parameter to WidgetTest.get_output.
  • Fix test_owmds and test_owtestlearners.
Includes
  • Code changes
  • Tests
  • Documentation

@codecov-io
Copy link

Codecov Report

Merging #2520 into master will increase coverage by 0.06%.
The diff coverage is 96.66%.

@@            Coverage Diff             @@
##           master    #2520      +/-   ##
==========================================
+ Coverage   74.55%   74.62%   +0.06%     
==========================================
  Files         320      320              
  Lines       56209    56225      +16     
==========================================
+ Hits        41909    41959      +50     
+ Misses      14300    14266      -34

@@ -215,31 +221,42 @@ def send_signal(self, input, value, *args, widget=None, wait=-1):
else:
raise ValueError("'{}' is not an input name for widget {}"
.format(input, type(widget).__name__))
if widget.isBlocking():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of the widget is blocking the code will not get past this check and therefore the "wait" parameter is not used. Was this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The (existing) wait is done after the inputs are set and handleNewSignals is called. It is somewhat misplaced , but I do not want to change it.

@astaric astaric merged commit 6da33a0 into biolab:master Aug 9, 2017
@ales-erjavec ales-erjavec deleted the fixes/async-tests branch November 14, 2017 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants