File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -796,7 +796,7 @@ def register_converter_cb(key):
796
796
797
797
def _is_formatter (x ):
798
798
if not (x is None or callable (x ) or isinstance (x , (dict , str ))):
799
- return ValueError ("Value must have type 'callable, dict, str' or None." )
799
+ raise ValueError ("Value must have type 'callable, dict, str' or None." )
800
800
801
801
802
802
with cf .config_prefix ("styler" ):
Original file line number Diff line number Diff line change @@ -310,3 +310,8 @@ def test_format_options_validator():
310
310
assert " 9.0 " in df .style .to_latex ()
311
311
with option_context ("styler.format.formatter" , None ):
312
312
assert " 9 " in df .style .to_latex ()
313
+
314
+ msg = "Value must have type"
315
+ with pytest .raises (ValueError , match = msg ):
316
+ with option_context ("styler.format.formatter" , ["bad" , "type" ]):
317
+ df .style .to_latex ()
You can’t perform that action at this time.
0 commit comments