@@ -49,10 +49,9 @@ def test_raises_on_bad_dot_property(some_fig):
49
49
e .args [0 ].find (
50
50
"""Bad property path:
51
51
layout.shapes[1].x2000
52
- ^^^^^
53
- Did you mean "x0"?"""
52
+ ^^^^^"""
54
53
)
55
- >= 0
54
+ and ( e . args [ 0 ]. find ( """Did you mean "x0"?""" ) >= 0 ) >= 0
56
55
)
57
56
assert raised
58
57
@@ -69,10 +68,9 @@ def test_raises_on_bad_ancestor_dot_property(some_fig):
69
68
e .args [0 ].find (
70
69
"""Bad property path:
71
70
layout.shapa[1].x2000
72
- ^^^^^
73
- Did you mean "shapes"?"""
71
+ ^^^^^"""
74
72
)
75
- >= 0
73
+ and ( e . args [ 0 ]. find ( """Did you mean "shapes"?""" ) >= 0 ) >= 0
76
74
)
77
75
assert raised
78
76
@@ -118,19 +116,18 @@ def test_raises_on_bad_indexed_underscore_property(some_fig):
118
116
"""
119
117
Bad property path:
120
118
data[0].line_colr
121
- ^^^^
122
- Did you mean "color"?""" ,
119
+ ^^^^""" ,
123
120
)
124
121
assert (
125
122
(
126
123
e .args [0 ].find (
127
124
"""Bad property path:
128
125
data[0].line_colr
129
- ^^^^
130
- Did you mean "color"?"""
126
+ ^^^^"""
131
127
)
132
128
>= 0
133
129
)
130
+ and (e .args [0 ].find ("""Did you mean "color"?""" ) >= 0 )
134
131
and (e_substr == e_correct_substr )
135
132
)
136
133
assert raised
@@ -170,10 +167,9 @@ def test_raises_on_bad_indexed_underscore_property(some_fig):
170
167
e .args [0 ].find (
171
168
"""Bad property path:
172
169
line_colr
173
- ^^^^
174
- Did you mean "color"?"""
170
+ ^^^^"""
175
171
)
176
- >= 0
172
+ and ( e . args [ 0 ]. find ( """Did you mean "color"?""" ) >= 0 ) >= 0
177
173
)
178
174
and (e_substr == e_correct_substr )
179
175
)
@@ -192,8 +188,7 @@ def test_raises_on_bad_indexed_underscore_property(some_fig):
192
188
"""
193
189
Bad property path:
194
190
txt
195
- ^^^
196
- Did you mean "text"?""" ,
191
+ ^^^""" ,
197
192
)
198
193
assert raised
199
194
@@ -210,8 +205,7 @@ def test_raises_on_bad_indexed_underscore_property(some_fig):
210
205
"""
211
206
Bad property path:
212
207
layout_title_txt
213
- ^^^
214
- Did you mean "text"?""" ,
208
+ ^^^""" ,
215
209
)
216
210
# also remove the invalid Figure property string added by the Figure constructor
217
211
e_substr = error_substr (
@@ -224,11 +218,11 @@ def test_raises_on_bad_indexed_underscore_property(some_fig):
224
218
e .args [0 ].find (
225
219
"""Bad property path:
226
220
layout_title_txt
227
- ^^^
228
- Did you mean "text"?""" ,
221
+ ^^^""" ,
229
222
)
230
223
>= 0
231
224
)
225
+ and (e .args [0 ].find ("""Did you mean "text"?""" ) >= 0 )
232
226
and (e_substr == e_correct_substr )
233
227
)
234
228
assert raised
@@ -245,8 +239,7 @@ def test_raises_on_bad_indexed_underscore_property(some_fig):
245
239
"""
246
240
Bad property path:
247
241
ltaxis
248
- ^^^^^^
249
- Did you mean "lataxis"?""" ,
242
+ ^^^^^^""" ,
250
243
)
251
244
assert raised
252
245
@@ -260,19 +253,18 @@ def test_raises_on_bad_indexed_underscore_property(some_fig):
260
253
"""
261
254
Bad property path:
262
255
geo_ltaxis_showgrid
263
- ^^^^^^
264
- Did you mean "lataxis"?""" ,
256
+ ^^^^^^""" ,
265
257
)
266
258
assert (
267
259
(
268
260
e .args [0 ].find (
269
261
"""Bad property path:
270
262
geo_ltaxis_showgrid
271
- ^^^^^^
272
- Did you mean "lataxis"?"""
263
+ ^^^^^^"""
273
264
)
274
265
>= 0
275
266
)
267
+ and (e .args [0 ].find ("""Did you mean "lataxis"?""" ) >= 0 )
276
268
and (e_substr == e_correct_substr )
277
269
)
278
270
assert raised
@@ -494,6 +486,7 @@ def _raise_bad_property_path_real():
494
486
("bogus" , "_hey_yall" ),
495
487
("^^^^^" , "^^^^" ),
496
488
('Did you mean "boxgap"' , 'Did you mean "geo"' ),
489
+ ('Did you mean "boxgap"' , 'Did you mean "geo"' ),
497
490
],
498
491
)
499
492
check_error_string (_raise_bad_property_path_real , ValueError , correct_err_str , [])
@@ -537,7 +530,8 @@ def _raise_bad_property_path_real():
537
530
[
538
531
("bogusey" , "_family" ),
539
532
("bogusey" , "_family" ),
540
- ('Did you mean "size"?' , 'Did you mean "family"?' ),
533
+ ('Did you mean "color"?' , 'Did you mean "family"?' ),
534
+ ('Did you mean "color"?' , 'Did you mean "family"?' ),
541
535
],
542
536
)
543
537
# no need to replace ^^^^^ because bogus and font_ are same length
@@ -560,6 +554,7 @@ def _raise_bad_property_path_real():
560
554
("bogus" , "_" ),
561
555
("^^^^^" , "^" ),
562
556
('Did you mean "boxgap"' , 'Did you mean "geo"' ),
557
+ ('Did you mean "boxgap"' , 'Did you mean "geo"' ),
563
558
],
564
559
)
565
560
check_error_string (_raise_bad_property_path_real , ValueError , correct_err_str , [])
@@ -581,6 +576,7 @@ def _raise_bad_property_path_real():
581
576
("bogus" , "__" ),
582
577
("^^^^^" , "^^" ),
583
578
('Did you mean "boxgap"' , 'Did you mean "geo"' ),
579
+ ('Did you mean "boxgap"' , 'Did you mean "geo"' ),
584
580
],
585
581
)
586
582
check_error_string (_raise_bad_property_path_real , ValueError , correct_err_str , [])
@@ -645,7 +641,8 @@ def _raise_bad_property_path_real():
645
641
[
646
642
("bogusey" , "_family" ),
647
643
("bogusey" , "_family" ),
648
- ('Did you mean "size"?' , 'Did you mean "family"?' ),
644
+ ('Did you mean "color"?' , 'Did you mean "family"?' ),
645
+ ('Did you mean "color"?' , 'Did you mean "family"?' ),
649
646
],
650
647
)
651
648
check_error_string (_raise_bad_property_path_real , ValueError , correct_err_str , [])
0 commit comments