@@ -407,7 +407,7 @@ def test_reading_all_sheets(self):
407
407
# Ensure a dict is returned.
408
408
# See PR #9450
409
409
basename = 'test_multisheet'
410
- dfs = self .get_exceldf (basename , sheetname = None )
410
+ dfs = self .get_exceldf (basename , sheet_name = None )
411
411
# ensure this is not alphabetical to test order preservation
412
412
expected_keys = ['Charlie' , 'Alpha' , 'Beta' ]
413
413
tm .assert_contains_all (expected_keys , dfs .keys ())
@@ -424,7 +424,7 @@ def test_reading_multiple_specific_sheets(self):
424
424
basename = 'test_multisheet'
425
425
# Explicitly request duplicates. Only the set should be returned.
426
426
expected_keys = [2 , 'Charlie' , 'Charlie' ]
427
- dfs = self .get_exceldf (basename , sheetname = expected_keys )
427
+ dfs = self .get_exceldf (basename , sheet_name = expected_keys )
428
428
expected_keys = list (set (expected_keys ))
429
429
tm .assert_contains_all (expected_keys , dfs .keys ())
430
430
assert len (expected_keys ) == len (dfs .keys ())
@@ -434,7 +434,7 @@ def test_reading_all_sheets_with_blank(self):
434
434
# In the case where some sheets are blank.
435
435
# Issue #11711
436
436
basename = 'blank_with_header'
437
- dfs = self .get_exceldf (basename , sheetname = None )
437
+ dfs = self .get_exceldf (basename , sheet_name = None )
438
438
expected_keys = ['Sheet1' , 'Sheet2' , 'Sheet3' ]
439
439
tm .assert_contains_all (expected_keys , dfs .keys ())
440
440
@@ -556,6 +556,10 @@ def test_sheet_name_and_sheetname(self):
556
556
tm .assert_frame_equal (df1 , dfref , check_names = False )
557
557
tm .assert_frame_equal (df2 , dfref , check_names = False )
558
558
559
+ def test_sheet_name_both_raises (self ):
560
+ with tm .assert_raises_regex (TypeError , "Cannot specify both" ):
561
+ self .get_exceldf ('test1' , sheetname = 'Sheet1' , sheet_name = 'Sheet1' )
562
+
559
563
560
564
class XlrdTests (ReadingTestsBase ):
561
565
"""
@@ -589,7 +593,7 @@ def test_read_xlrd_Book(self):
589
593
result = read_excel (xl , "SheetA" )
590
594
tm .assert_frame_equal (df , result )
591
595
592
- result = read_excel (book , sheetname = "SheetA" , engine = "xlrd" )
596
+ result = read_excel (book , sheet_name = "SheetA" , engine = "xlrd" )
593
597
tm .assert_frame_equal (df , result )
594
598
595
599
@tm .network
@@ -691,7 +695,7 @@ def tdf(sheetname):
691
695
with ExcelWriter (pth ) as ew :
692
696
for sheetname , df in iteritems (dfs ):
693
697
df .to_excel (ew , sheetname )
694
- dfs_returned = read_excel (pth , sheetname = sheets )
698
+ dfs_returned = read_excel (pth , sheet_name = sheets )
695
699
for s in sheets :
696
700
tm .assert_frame_equal (dfs [s ], dfs_returned [s ])
697
701
0 commit comments