Skip to content

Commit

Permalink
OWScatterPlot: Do not show messages when data is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Nov 4, 2016
1 parent 3520290 commit b27998c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions Orange/widgets/visualize/owscatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def reset_graph_data(self, *_):
self.update_graph()

def set_data(self, data):
self.clear_messages()
self.Information.sampled_sql.clear()
self.__timer.stop()
self.sampling.setVisible(False)
Expand Down
10 changes: 10 additions & 0 deletions Orange/widgets/visualize/tests/test_owscatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,13 @@ def test_optional_combos(self):
def _select_data(self):
self.widget.graph.select_by_rectangle(QRectF(4, 3, 3, 1))
return self.widget.graph.get_selection()

def test_error_message(self):
"""Check if error message appears and then disappears when
data is removed from input"""
data = self.data.copy()
data.X[:, 0] = np.nan
self.send_signal("Data", data)
self.assertTrue(self.widget.Warning.missing_coords.is_shown())
self.send_signal("Data", None)
self.assertFalse(self.widget.Warning.missing_coords.is_shown())

0 comments on commit b27998c

Please sign in to comment.