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