@@ -88,6 +88,7 @@ def setUp(self):
8888 self .xls1 = os .path .join (self .dirpath , 'test.xls' )
8989 self .xlsx1 = os .path .join (self .dirpath , 'test.xlsx' )
9090 self .multisheet = os .path .join (self .dirpath , 'test_multisheet.xlsx' )
91+ self .multi_ods = os .path .join (self .dirpath , 'test_multisheet.ods' )
9192 self .ods1 = os .path .join (self .dirpath , 'test.ods' )
9293 self .frame = _frame .copy ()
9394 self .frame2 = _frame2 .copy ()
@@ -460,59 +461,63 @@ def test_reader_converters(self):
460461 for path in (xls_path , xlsx_path , ods_path ):
461462 actual = read_excel (path , 'Sheet1' , converters = converters )
462463 tm .assert_frame_equal (actual , expected )
463-
464+
464465 def test_reading_all_sheets (self ):
465466 # Test reading all sheetnames by setting sheetname to None,
466467 # Ensure a dict is returned.
467468 # See PR #9450
468-
469+
469470 _skip_if_no_xlrd ()
470-
471- dfs = read_excel (self .multisheet ,sheetname = None )
472- expected_keys = ['Alpha' ,'Beta' ,'Charlie' ]
473- tm .assert_contains_all (expected_keys ,dfs .keys ())
471+ _skip_if_no_ezodf ()
472+
473+ for multi in [self .multisheet , self .multi_ods ]:
474+ dfs = read_excel (multi , sheetname = None )
475+ expected_keys = ['Alpha' , 'Beta' , 'Charlie' ]
476+ tm .assert_contains_all (expected_keys , dfs .keys ())
474477
475478 def test_reading_multiple_specific_sheets (self ):
476- # Test reading specific sheetnames by specifying a mixed list
479+ # Test reading specific sheetnames by specifying a mixed list
477480 # of integers and strings, and confirm that duplicated sheet
478481 # references (positions/names) are removed properly.
479-
482+
480483 # Ensure a dict is returned
481484 # See PR #9450
482485 _skip_if_no_xlrd ()
483-
484- #Explicitly request duplicates. Only the set should be returned.
485- expected_keys = [2 ,'Charlie' ,'Charlie' ]
486- dfs = read_excel (self .multisheet ,sheetname = expected_keys )
487- expected_keys = list (set (expected_keys ))
488- tm .assert_contains_all (expected_keys ,dfs .keys ())
489- assert len (expected_keys ) == len (dfs .keys ())
486+ _skip_if_no_ezodf ()
487+
488+ # Explicitly request duplicates. Only the set should be returned.
489+ for multi in [self .multisheet , self .multi_ods ]:
490+ expected_keys = [2 , 'Charlie' , 'Charlie' ]
491+ dfs = read_excel (multi , sheetname = expected_keys )
492+ expected_keys = list (set (expected_keys ))
493+ tm .assert_contains_all (expected_keys , dfs .keys ())
494+ assert len (expected_keys ) == len (dfs .keys ())
490495
491496 def test_creating_and_reading_multiple_sheets (self ):
492497 # Test reading multiple sheets, from a runtime created excel file
493498 # with multiple sheets.
494- # See PR #9450
495-
499+ # See PR #9450
500+
496501 _skip_if_no_xlrd ()
497502 _skip_if_no_xlwt ()
498-
503+
499504 def tdf (sheetname ):
500505 d , i = [11 ,22 ,33 ], [1 ,2 ,3 ]
501506 return DataFrame (d ,i ,columns = [sheetname ])
502-
507+
503508 sheets = ['AAA' ,'BBB' ,'CCC' ]
504-
509+
505510 dfs = [tdf (s ) for s in sheets ]
506511 dfs = dict (zip (sheets ,dfs ))
507-
512+
508513 with ensure_clean ('.xlsx' ) as pth :
509514 with ExcelWriter (pth ) as ew :
510515 for sheetname , df in dfs .iteritems ():
511516 df .to_excel (ew ,sheetname )
512517 dfs_returned = pd .read_excel (pth ,sheetname = sheets )
513518 for s in sheets :
514519 tm .assert_frame_equal (dfs [s ],dfs_returned [s ])
515-
520+
516521 def test_reader_seconds (self ):
517522 # Test reading times with and without milliseconds. GH5945.
518523 _skip_if_no_xlrd ()
0 commit comments