File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,8 @@ def get_widget_name_extension(self):
494494 return "{} vs {}" .format (self .attr_x .name , self .attr_y .name )
495495
496496 def send_report (self ):
497+ if self .data is None :
498+ return
497499 def name (var ):
498500 return var and var .name
499501 caption = report .render_items_vert ((
Original file line number Diff line number Diff line change 11# Test methods with long descriptive names can omit docstrings
22# pylint: disable=missing-docstring
3+ from unittest .mock import MagicMock
4+
35import numpy as np
46
57from AnyQt .QtCore import QRectF
@@ -91,3 +93,12 @@ def test_error_message(self):
9193 self .assertTrue (self .widget .Warning .missing_coords .is_shown ())
9294 self .send_signal ("Data" , None )
9395 self .assertFalse (self .widget .Warning .missing_coords .is_shown ())
96+
97+ def test_report_on_empty (self ):
98+ self .widget .report_plot = MagicMock ()
99+ self .widget .report_caption = MagicMock ()
100+ self .widget .report_items = MagicMock ()
101+ self .widget .send_report () # Essentially, don't crash
102+ self .widget .report_plot .assert_not_called ()
103+ self .widget .report_caption .assert_not_called ()
104+ self .widget .report_items .assert_not_called ()
You can’t perform that action at this time.
0 commit comments