@@ -625,24 +625,21 @@ def test_formated_header_mi_multi_index_throws(self):
625
625
("Amazing" , "C" ), ("Amazing" , "D" )
626
626
]
627
627
columns = MultiIndex .from_tuples (header )
628
+ rng = np .random .default_rng ()
628
629
df = DataFrame (
629
- np . random . randn ( 4 , 4 ),
630
+ rng . standard_normal (( 4 , 4 ) ),
630
631
columns = columns
631
632
)
632
633
formatter = ExcelFormatter (df , index = False )
633
634
assert (formatter .columns .nlevels > 1 and not formatter .index )
634
- msg = (
635
- "Writing to Excel with MultiIndex columns and no "
636
- "index ('index'=False) is not yet implemented."
637
- )
638
635
with pytest .raises (NotImplementedError ):
639
636
list (formatter ._format_header_mi ())
640
637
641
638
def test_returns_none_no_header (self ):
642
639
df = DataFrame ({"A" : [1 ,2 ], "B" : [3 ,4 ]})
643
640
formatter = ExcelFormatter (df ,header = False )
644
- assert (formatter ._has_aliases == False )
645
- assert (list (formatter ._format_header_mi ()) == list () )
641
+ assert (not formatter ._has_aliases )
642
+ assert (list (formatter ._format_header_mi ()) == [] )
646
643
647
644
@pytest .mark .parametrize (
648
645
"df, merge_cells, expected_cells" ,
@@ -1014,7 +1011,8 @@ def test_generate_body_general(self, df, coloffset, rowcounter, expected_cells):
1014
1011
),
1015
1012
],
1016
1013
)
1017
- def test_get_formatted_cells_integration (self , df , formatter_options , expected_values ):
1014
+ def test_get_formatted_cells_integration (self , df , formatter_options ,
1015
+ expected_values ):
1018
1016
"""
1019
1017
Integration test for get_formatted_cells to ensure it chains all
1020
1018
formatting methods and applies final value formatting correctly.
0 commit comments