@@ -919,13 +919,13 @@ def get_header_style(self) -> str:
919919
920920def test_html_formatter_memory_and_rows ():
921921 """Test the memory and row control parameters in DataFrameHtmlFormatter."""
922-
922+
923923 # Test default values
924924 formatter = DataFrameHtmlFormatter ()
925925 assert formatter .max_memory_bytes == 2 * 1024 * 1024 # 2 MB
926926 assert formatter .min_rows_display == 20
927927 assert formatter .repr_rows == 10
928-
928+
929929 # Test custom values
930930 formatter = DataFrameHtmlFormatter (
931931 max_memory_bytes = 1024 * 1024 , # 1 MB
@@ -935,7 +935,7 @@ def test_html_formatter_memory_and_rows():
935935 assert formatter .max_memory_bytes == 1024 * 1024
936936 assert formatter .min_rows_display == 10
937937 assert formatter .repr_rows == 5
938-
938+
939939 # Test extremely large values and tiny values (edge cases)
940940 # These should not raise exceptions
941941 extreme_formatter = DataFrameHtmlFormatter (
@@ -946,29 +946,30 @@ def test_html_formatter_memory_and_rows():
946946 assert extreme_formatter .max_memory_bytes == 10 * 1024 * 1024 * 1024
947947 assert extreme_formatter .min_rows_display == 1
948948 assert extreme_formatter .repr_rows == 1
949-
949+
950950 # Test validation for invalid parameters
951951 with pytest .raises (ValueError , match = "max_memory_bytes must be a positive integer" ):
952952 DataFrameHtmlFormatter (max_memory_bytes = 0 )
953-
953+
954954 with pytest .raises (ValueError , match = "max_memory_bytes must be a positive integer" ):
955955 DataFrameHtmlFormatter (max_memory_bytes = - 100 )
956-
956+
957957 with pytest .raises (ValueError , match = "min_rows_display must be a positive integer" ):
958958 DataFrameHtmlFormatter (min_rows_display = 0 )
959-
959+
960960 with pytest .raises (ValueError , match = "min_rows_display must be a positive integer" ):
961961 DataFrameHtmlFormatter (min_rows_display = - 5 )
962-
962+
963963 with pytest .raises (ValueError , match = "repr_rows must be a positive integer" ):
964964 DataFrameHtmlFormatter (repr_rows = 0 )
965-
965+
966966 with pytest .raises (ValueError , match = "repr_rows must be a positive integer" ):
967967 DataFrameHtmlFormatter (repr_rows = - 10 )
968968
969969
970- def test_html_formatter_custom_style_provider_with_parameters (df , clean_formatter_state ):
971- """Test using custom style providers with the HTML formatter and configured parameters."""
970+ def test_custom_style_provider_html_formatter (df , clean_formatter_state ):
971+ """Test using custom style providers with the HTML formatter and configured
972+ parameters."""
972973
973974 class CustomStyleProvider :
974975 def get_cell_style (self ) -> str :
@@ -995,7 +996,7 @@ def get_header_style(self) -> str:
995996
996997 # Reset for the next part of the test
997998 reset_formatter ()
998-
999+
9991000 # Configure with custom style provider and additional parameters
10001001 configure_formatter (
10011002 style_provider = CustomStyleProvider (),
@@ -1747,4 +1748,4 @@ def test_html_formatter_manual_format_html(clean_formatter_state):
17471748 local_html_2 = local_formatter .format_html ([batch ], batch .schema )
17481749
17491750 assert "<style>" in local_html_1
1750- assert "<style>" in local_html_2
1751+ assert "<style>" in local_html_2
0 commit comments