diff --git a/Orange/widgets/visualize/owscatterplot.py b/Orange/widgets/visualize/owscatterplot.py index 5867777172d..f222791b8e6 100644 --- a/Orange/widgets/visualize/owscatterplot.py +++ b/Orange/widgets/visualize/owscatterplot.py @@ -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) diff --git a/Orange/widgets/visualize/tests/test_owscatterplot.py b/Orange/widgets/visualize/tests/test_owscatterplot.py index 08c59933b3e..91b0b7fb62c 100644 --- a/Orange/widgets/visualize/tests/test_owscatterplot.py +++ b/Orange/widgets/visualize/tests/test_owscatterplot.py @@ -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())