@@ -1109,7 +1109,7 @@ class and any subclasses, on account of the `autouse=True`
1109
1109
class TestExcelWriter (_WriterBase ):
1110
1110
# Base class for test cases to run with different Excel writers.
1111
1111
1112
- def test_excel_sheet_size (self ):
1112
+ def test_excel_sheet_size (self , merge_cells , engine , ext ):
1113
1113
1114
1114
# GH 26080
1115
1115
breaking_row_count = 2 ** 20 + 1
@@ -1127,7 +1127,7 @@ def test_excel_sheet_size(self):
1127
1127
with pytest .raises (ValueError , match = msg ):
1128
1128
col_df .to_excel (self .path )
1129
1129
1130
- def test_excel_sheet_by_name_raise (self , * _ ):
1130
+ def test_excel_sheet_by_name_raise (self , merge_cells , engine , ext ):
1131
1131
import xlrd
1132
1132
1133
1133
gt = DataFrame (np .random .randn (10 , 2 ))
@@ -1141,7 +1141,8 @@ def test_excel_sheet_by_name_raise(self, *_):
1141
1141
with pytest .raises (xlrd .XLRDError ):
1142
1142
pd .read_excel (xl , "0" )
1143
1143
1144
- def test_excel_writer_context_manager (self , frame , * _ ):
1144
+ def test_excel_writer_context_manager (
1145
+ self , frame , merge_cells , engine , ext ):
1145
1146
with ExcelWriter (self .path ) as writer :
1146
1147
frame .to_excel (writer , "Data1" )
1147
1148
frame2 = frame .copy ()
@@ -1214,7 +1215,7 @@ def test_mixed(self, merge_cells, engine, ext, frame):
1214
1215
recons = pd .read_excel (reader , 'test1' , index_col = 0 )
1215
1216
tm .assert_frame_equal (mixed_frame , recons )
1216
1217
1217
- def test_ts_frame (self , tsframe , * _ ):
1218
+ def test_ts_frame (self , tsframe , merge_cells , engine , ext ):
1218
1219
df = tsframe
1219
1220
1220
1221
df .to_excel (self .path , "test1" )
@@ -1280,7 +1281,7 @@ def test_bool_types(self, merge_cells, engine, ext, np_type):
1280
1281
1281
1282
tm .assert_frame_equal (df , recons )
1282
1283
1283
- def test_inf_roundtrip (self , * _ ):
1284
+ def test_inf_roundtrip (self , merge_cells , engine , ext ):
1284
1285
df = DataFrame ([(1 , np .inf ), (2 , 3 ), (5 , - np .inf )])
1285
1286
df .to_excel (self .path , "test1" )
1286
1287
@@ -1396,7 +1397,7 @@ def test_excel_roundtrip_indexname(self, merge_cells, engine, ext):
1396
1397
tm .assert_frame_equal (result , df )
1397
1398
assert result .index .name == 'foo'
1398
1399
1399
- def test_excel_roundtrip_datetime (self , merge_cells , tsframe , * _ ):
1400
+ def test_excel_roundtrip_datetime (self , merge_cells , tsframe , engine , ext ):
1400
1401
# datetime.date, not sure what to test here exactly
1401
1402
tsf = tsframe .copy ()
1402
1403
@@ -1447,7 +1448,7 @@ def test_excel_date_datetime_format(self, merge_cells, engine, ext):
1447
1448
# we need to use df_expected to check the result.
1448
1449
tm .assert_frame_equal (rs2 , df_expected )
1449
1450
1450
- def test_to_excel_interval_no_labels (self , * _ ):
1451
+ def test_to_excel_interval_no_labels (self , merge_cells , engine , ext ):
1451
1452
# see gh-19242
1452
1453
#
1453
1454
# Test writing Interval without labels.
@@ -1464,7 +1465,7 @@ def test_to_excel_interval_no_labels(self, *_):
1464
1465
recons = pd .read_excel (reader , "test1" , index_col = 0 )
1465
1466
tm .assert_frame_equal (expected , recons )
1466
1467
1467
- def test_to_excel_interval_labels (self , * _ ):
1468
+ def test_to_excel_interval_labels (self , merge_cells , engine , ext ):
1468
1469
# see gh-19242
1469
1470
#
1470
1471
# Test writing Interval with labels.
@@ -1482,7 +1483,7 @@ def test_to_excel_interval_labels(self, *_):
1482
1483
recons = pd .read_excel (reader , "test1" , index_col = 0 )
1483
1484
tm .assert_frame_equal (expected , recons )
1484
1485
1485
- def test_to_excel_timedelta (self , * _ ):
1486
+ def test_to_excel_timedelta (self , merge_cells , engine , ext ):
1486
1487
# see gh-19242, gh-9155
1487
1488
#
1488
1489
# Test writing timedelta to xls.
@@ -1599,7 +1600,7 @@ def test_to_excel_multiindex_no_write_index(self, merge_cells, engine,
1599
1600
# Test that it is the same as the initial frame.
1600
1601
tm .assert_frame_equal (frame1 , frame3 )
1601
1602
1602
- def test_to_excel_float_format (self , * _ ):
1603
+ def test_to_excel_float_format (self , merge_cells , engine , ext ):
1603
1604
df = DataFrame ([[0.123456 , 0.234567 , 0.567567 ],
1604
1605
[12.32112 , 123123.2 , 321321.2 ]],
1605
1606
index = ["A" , "B" ], columns = ["X" , "Y" , "Z" ])
@@ -1798,7 +1799,7 @@ def roundtrip(data, header=True, parser_hdr=0, index=True):
1798
1799
for c in range (len (res .columns )):
1799
1800
assert res .iloc [r , c ] is not np .nan
1800
1801
1801
- def test_duplicated_columns (self , * _ ):
1802
+ def test_duplicated_columns (self , merge_cells , engine , ext ):
1802
1803
# see gh-5235
1803
1804
df = DataFrame ([[1 , 2 , 3 ], [1 , 2 , 3 ], [1 , 2 , 3 ]],
1804
1805
columns = ["A" , "B" , "B" ])
@@ -1848,7 +1849,7 @@ def test_swapped_columns(self, merge_cells, engine, ext):
1848
1849
tm .assert_series_equal (write_frame ['A' ], read_frame ['A' ])
1849
1850
tm .assert_series_equal (write_frame ['B' ], read_frame ['B' ])
1850
1851
1851
- def test_invalid_columns (self , * _ ):
1852
+ def test_invalid_columns (self , merge_cells , engine , ext ):
1852
1853
# see gh-10982
1853
1854
write_frame = DataFrame ({"A" : [1 , 1 , 1 ],
1854
1855
"B" : [2 , 2 , 2 ]})
@@ -1864,7 +1865,7 @@ def test_invalid_columns(self, *_):
1864
1865
with pytest .raises (KeyError ):
1865
1866
write_frame .to_excel (self .path , "test1" , columns = ["C" , "D" ])
1866
1867
1867
- def test_comment_arg (self , * _ ):
1868
+ def test_comment_arg (self , merge_cells , engine , ext ):
1868
1869
# see gh-18735
1869
1870
#
1870
1871
# Test the comment argument functionality to pd.read_excel.
@@ -1898,7 +1899,7 @@ def test_comment_default(self, merge_cells, engine, ext):
1898
1899
result2 = pd .read_excel (self .path , 'test_c' , comment = None )
1899
1900
tm .assert_frame_equal (result1 , result2 )
1900
1901
1901
- def test_comment_used (self , * _ ):
1902
+ def test_comment_used (self , merge_cells , engine , ext ):
1902
1903
# see gh-18735
1903
1904
#
1904
1905
# Test the comment argument is working as expected when used.
@@ -1961,7 +1962,7 @@ def test_bytes_io(self, merge_cells, engine, ext):
1961
1962
reread_df = pd .read_excel (bio , index_col = 0 )
1962
1963
tm .assert_frame_equal (df , reread_df )
1963
1964
1964
- def test_write_lists_dict (self , * _ ):
1965
+ def test_write_lists_dict (self , merge_cells , engine , ext ):
1965
1966
# see gh-8188.
1966
1967
df = DataFrame ({"mixed" : ["a" , ["b" , "c" ], {"d" : "e" , "f" : 2 }],
1967
1968
"numeric" : [1 , 2 , 3.0 ],
@@ -1975,7 +1976,7 @@ def test_write_lists_dict(self, *_):
1975
1976
1976
1977
tm .assert_frame_equal (read , expected )
1977
1978
1978
- def test_true_and_false_value_options (self , * _ ):
1979
+ def test_true_and_false_value_options (self , merge_cells , engine , ext ):
1979
1980
# see gh-13347
1980
1981
df = pd .DataFrame ([["foo" , "bar" ]], columns = ["col1" , "col2" ])
1981
1982
expected = df .replace ({"foo" : True , "bar" : False })
@@ -1985,7 +1986,7 @@ def test_true_and_false_value_options(self, *_):
1985
1986
false_values = ["bar" ], index_col = 0 )
1986
1987
tm .assert_frame_equal (read_frame , expected )
1987
1988
1988
- def test_freeze_panes (self , * _ ):
1989
+ def test_freeze_panes (self , merge_cells , engine , ext ):
1989
1990
# see gh-15160
1990
1991
expected = DataFrame ([[1 , 2 ], [3 , 4 ]], columns = ["col1" , "col2" ])
1991
1992
expected .to_excel (self .path , "Sheet1" , freeze_panes = (1 , 1 ))
0 commit comments