Skip to content

Commit a5d2616

Browse files
committed
Replaced *args with explicit fixture usage
1 parent 417fc30 commit a5d2616

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

pandas/tests/io/test_excel.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ class and any subclasses, on account of the `autouse=True`
11091109
class TestExcelWriter(_WriterBase):
11101110
# Base class for test cases to run with different Excel writers.
11111111

1112-
def test_excel_sheet_size(self):
1112+
def test_excel_sheet_size(self, merge_cells, engine, ext):
11131113

11141114
# GH 26080
11151115
breaking_row_count = 2**20 + 1
@@ -1127,7 +1127,7 @@ def test_excel_sheet_size(self):
11271127
with pytest.raises(ValueError, match=msg):
11281128
col_df.to_excel(self.path)
11291129

1130-
def test_excel_sheet_by_name_raise(self, *_):
1130+
def test_excel_sheet_by_name_raise(self, merge_cells, engine, ext):
11311131
import xlrd
11321132

11331133
gt = DataFrame(np.random.randn(10, 2))
@@ -1141,7 +1141,8 @@ def test_excel_sheet_by_name_raise(self, *_):
11411141
with pytest.raises(xlrd.XLRDError):
11421142
pd.read_excel(xl, "0")
11431143

1144-
def test_excel_writer_context_manager(self, frame, *_):
1144+
def test_excel_writer_context_manager(
1145+
self, frame, merge_cells, engine, ext):
11451146
with ExcelWriter(self.path) as writer:
11461147
frame.to_excel(writer, "Data1")
11471148
frame2 = frame.copy()
@@ -1214,7 +1215,7 @@ def test_mixed(self, merge_cells, engine, ext, frame):
12141215
recons = pd.read_excel(reader, 'test1', index_col=0)
12151216
tm.assert_frame_equal(mixed_frame, recons)
12161217

1217-
def test_ts_frame(self, tsframe, *_):
1218+
def test_ts_frame(self, tsframe, merge_cells, engine, ext):
12181219
df = tsframe
12191220

12201221
df.to_excel(self.path, "test1")
@@ -1280,7 +1281,7 @@ def test_bool_types(self, merge_cells, engine, ext, np_type):
12801281

12811282
tm.assert_frame_equal(df, recons)
12821283

1283-
def test_inf_roundtrip(self, *_):
1284+
def test_inf_roundtrip(self, merge_cells, engine, ext):
12841285
df = DataFrame([(1, np.inf), (2, 3), (5, -np.inf)])
12851286
df.to_excel(self.path, "test1")
12861287

@@ -1396,7 +1397,7 @@ def test_excel_roundtrip_indexname(self, merge_cells, engine, ext):
13961397
tm.assert_frame_equal(result, df)
13971398
assert result.index.name == 'foo'
13981399

1399-
def test_excel_roundtrip_datetime(self, merge_cells, tsframe, *_):
1400+
def test_excel_roundtrip_datetime(self, merge_cells, tsframe, engine, ext):
14001401
# datetime.date, not sure what to test here exactly
14011402
tsf = tsframe.copy()
14021403

@@ -1447,7 +1448,7 @@ def test_excel_date_datetime_format(self, merge_cells, engine, ext):
14471448
# we need to use df_expected to check the result.
14481449
tm.assert_frame_equal(rs2, df_expected)
14491450

1450-
def test_to_excel_interval_no_labels(self, *_):
1451+
def test_to_excel_interval_no_labels(self, merge_cells, engine, ext):
14511452
# see gh-19242
14521453
#
14531454
# Test writing Interval without labels.
@@ -1464,7 +1465,7 @@ def test_to_excel_interval_no_labels(self, *_):
14641465
recons = pd.read_excel(reader, "test1", index_col=0)
14651466
tm.assert_frame_equal(expected, recons)
14661467

1467-
def test_to_excel_interval_labels(self, *_):
1468+
def test_to_excel_interval_labels(self, merge_cells, engine, ext):
14681469
# see gh-19242
14691470
#
14701471
# Test writing Interval with labels.
@@ -1482,7 +1483,7 @@ def test_to_excel_interval_labels(self, *_):
14821483
recons = pd.read_excel(reader, "test1", index_col=0)
14831484
tm.assert_frame_equal(expected, recons)
14841485

1485-
def test_to_excel_timedelta(self, *_):
1486+
def test_to_excel_timedelta(self, merge_cells, engine, ext):
14861487
# see gh-19242, gh-9155
14871488
#
14881489
# Test writing timedelta to xls.
@@ -1599,7 +1600,7 @@ def test_to_excel_multiindex_no_write_index(self, merge_cells, engine,
15991600
# Test that it is the same as the initial frame.
16001601
tm.assert_frame_equal(frame1, frame3)
16011602

1602-
def test_to_excel_float_format(self, *_):
1603+
def test_to_excel_float_format(self, merge_cells, engine, ext):
16031604
df = DataFrame([[0.123456, 0.234567, 0.567567],
16041605
[12.32112, 123123.2, 321321.2]],
16051606
index=["A", "B"], columns=["X", "Y", "Z"])
@@ -1798,7 +1799,7 @@ def roundtrip(data, header=True, parser_hdr=0, index=True):
17981799
for c in range(len(res.columns)):
17991800
assert res.iloc[r, c] is not np.nan
18001801

1801-
def test_duplicated_columns(self, *_):
1802+
def test_duplicated_columns(self, merge_cells, engine, ext):
18021803
# see gh-5235
18031804
df = DataFrame([[1, 2, 3], [1, 2, 3], [1, 2, 3]],
18041805
columns=["A", "B", "B"])
@@ -1848,7 +1849,7 @@ def test_swapped_columns(self, merge_cells, engine, ext):
18481849
tm.assert_series_equal(write_frame['A'], read_frame['A'])
18491850
tm.assert_series_equal(write_frame['B'], read_frame['B'])
18501851

1851-
def test_invalid_columns(self, *_):
1852+
def test_invalid_columns(self, merge_cells, engine, ext):
18521853
# see gh-10982
18531854
write_frame = DataFrame({"A": [1, 1, 1],
18541855
"B": [2, 2, 2]})
@@ -1864,7 +1865,7 @@ def test_invalid_columns(self, *_):
18641865
with pytest.raises(KeyError):
18651866
write_frame.to_excel(self.path, "test1", columns=["C", "D"])
18661867

1867-
def test_comment_arg(self, *_):
1868+
def test_comment_arg(self, merge_cells, engine, ext):
18681869
# see gh-18735
18691870
#
18701871
# Test the comment argument functionality to pd.read_excel.
@@ -1898,7 +1899,7 @@ def test_comment_default(self, merge_cells, engine, ext):
18981899
result2 = pd.read_excel(self.path, 'test_c', comment=None)
18991900
tm.assert_frame_equal(result1, result2)
19001901

1901-
def test_comment_used(self, *_):
1902+
def test_comment_used(self, merge_cells, engine, ext):
19021903
# see gh-18735
19031904
#
19041905
# Test the comment argument is working as expected when used.
@@ -1961,7 +1962,7 @@ def test_bytes_io(self, merge_cells, engine, ext):
19611962
reread_df = pd.read_excel(bio, index_col=0)
19621963
tm.assert_frame_equal(df, reread_df)
19631964

1964-
def test_write_lists_dict(self, *_):
1965+
def test_write_lists_dict(self, merge_cells, engine, ext):
19651966
# see gh-8188.
19661967
df = DataFrame({"mixed": ["a", ["b", "c"], {"d": "e", "f": 2}],
19671968
"numeric": [1, 2, 3.0],
@@ -1975,7 +1976,7 @@ def test_write_lists_dict(self, *_):
19751976

19761977
tm.assert_frame_equal(read, expected)
19771978

1978-
def test_true_and_false_value_options(self, *_):
1979+
def test_true_and_false_value_options(self, merge_cells, engine, ext):
19791980
# see gh-13347
19801981
df = pd.DataFrame([["foo", "bar"]], columns=["col1", "col2"])
19811982
expected = df.replace({"foo": True, "bar": False})
@@ -1985,7 +1986,7 @@ def test_true_and_false_value_options(self, *_):
19851986
false_values=["bar"], index_col=0)
19861987
tm.assert_frame_equal(read_frame, expected)
19871988

1988-
def test_freeze_panes(self, *_):
1989+
def test_freeze_panes(self, merge_cells, engine, ext):
19891990
# see gh-15160
19901991
expected = DataFrame([[1, 2], [3, 4]], columns=["col1", "col2"])
19911992
expected.to_excel(self.path, "Sheet1", freeze_panes=(1, 1))

0 commit comments

Comments
 (0)