Skip to content

Commit f5bec5b

Browse files
committed
test: add tests for invalid parameters in configure_formatter
1 parent 2314613 commit f5bec5b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

python/tests/test_dataframe.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,20 @@ def test_configure_formatter(df, clean_formatter_state):
10511051
assert formatter_custom.use_shared_styles == use_shared_styles
10521052

10531053

1054+
def test_configure_formatter_invalid_params(clean_formatter_state):
1055+
"""Test that configure_formatter rejects invalid parameters."""
1056+
with pytest.raises(ValueError, match="Invalid formatter parameters"):
1057+
configure_formatter(invalid_param=123)
1058+
1059+
# Test with multiple parameters, one valid and one invalid
1060+
with pytest.raises(ValueError, match="Invalid formatter parameters"):
1061+
configure_formatter(max_width=500, not_a_real_param="test")
1062+
1063+
# Test with multiple invalid parameters
1064+
with pytest.raises(ValueError, match="Invalid formatter parameters"):
1065+
configure_formatter(fake_param1="test", fake_param2=456)
1066+
1067+
10541068
def test_get_dataframe(tmp_path):
10551069
ctx = SessionContext()
10561070

@@ -1780,3 +1794,4 @@ def test_html_formatter_manual_format_html(clean_formatter_state):
17801794

17811795
assert "<style>" in local_html_1
17821796
assert "<style>" in local_html_2
1797+

0 commit comments

Comments
 (0)