11import plotly .graph_objects as go
2- from _plotly_utils .exceptions import PlotlyKeyError
32import pytest
43import sys
54
@@ -23,7 +22,7 @@ def test_raises_on_bad_index(some_fig):
2322 # Check indexing errors can be detected when path used as key to go.Figure
2423 raised = False
2524 try :
26- x0 = some_fig ["layout.shapes[2].x0" ]
25+ some_fig ["layout.shapes[2].x0" ]
2726 except KeyError as e :
2827 raised = True
2928 assert (
@@ -43,7 +42,7 @@ def test_raises_on_bad_dot_property(some_fig):
4342 # go.Figure
4443 raised = False
4544 try :
46- x2000 = some_fig ["layout.shapes[1].x2000" ]
45+ some_fig ["layout.shapes[1].x2000" ]
4746 except KeyError as e :
4847 raised = True
4948 assert (
@@ -62,7 +61,7 @@ def test_raises_on_bad_ancestor_dot_property(some_fig):
6261 # Check . property lookup errors but not on the last part of the path
6362 raised = False
6463 try :
65- x2000 = some_fig ["layout.shapa[1].x2000" ]
64+ some_fig ["layout.shapa[1].x2000" ]
6665 except KeyError as e :
6766 raised = True
6867 assert (
@@ -181,7 +180,7 @@ def test_raises_on_bad_indexed_underscore_property(some_fig):
181180 # BaseFigure and throws the error for the last good property found in
182181 # the path
183182 try :
184- fig2 = go .Figure (layout = dict (title = dict (txt = "two" )))
183+ go .Figure (layout = dict (title = dict (txt = "two" )))
185184 except ValueError as e_correct :
186185 raised = True
187186 e_correct_substr = error_substr (
@@ -195,7 +194,7 @@ def test_raises_on_bad_indexed_underscore_property(some_fig):
195194
196195 raised = False
197196 try :
198- fig2 = go .Figure (layout_title_txt = "two" )
197+ go .Figure (layout_title_txt = "two" )
199198 except TypeError as e :
200199 raised = True
201200 # when the Figure constructor sees the same ValueError above, a
@@ -421,14 +420,14 @@ def test_subscript_error_exception_types(some_fig):
421420 with pytest .raises (ValueError ):
422421 some_fig .update_layout (width_yo = 100 )
423422 with pytest .raises (KeyError ):
424- yo = some_fig ["layout_width_yo" ]
423+ some_fig ["layout_width_yo" ]
425424
426425 some_fig .update_layout (width = 100 )
427426 # when width is specified
428427 with pytest .raises (ValueError ):
429428 some_fig .update_layout (width_yo = 100 )
430429 with pytest .raises (KeyError ):
431- yo = some_fig ["layout_width_yo" ]
430+ some_fig ["layout_width_yo" ]
432431
433432
434433def form_error_string (call , exception , subs ):
0 commit comments