@@ -891,107 +891,6 @@ def test_to_excel_unicode_filename(self, ext, path):
891
891
)
892
892
tm .assert_frame_equal (result , expected )
893
893
894
- # FIXME: dont leave commented-out
895
- # def test_to_excel_header_styling_xls(self, engine, ext):
896
-
897
- # import StringIO
898
- # s = StringIO(
899
- # """Date,ticker,type,value
900
- # 2001-01-01,x,close,12.2
901
- # 2001-01-01,x,open ,12.1
902
- # 2001-01-01,y,close,12.2
903
- # 2001-01-01,y,open ,12.1
904
- # 2001-02-01,x,close,12.2
905
- # 2001-02-01,x,open ,12.1
906
- # 2001-02-01,y,close,12.2
907
- # 2001-02-01,y,open ,12.1
908
- # 2001-03-01,x,close,12.2
909
- # 2001-03-01,x,open ,12.1
910
- # 2001-03-01,y,close,12.2
911
- # 2001-03-01,y,open ,12.1""")
912
- # df = read_csv(s, parse_dates=["Date"])
913
- # pdf = df.pivot_table(values="value", rows=["ticker"],
914
- # cols=["Date", "type"])
915
-
916
- # try:
917
- # import xlwt
918
- # import xlrd
919
- # except ImportError:
920
- # pytest.skip
921
-
922
- # filename = '__tmp_to_excel_header_styling_xls__.xls'
923
- # pdf.to_excel(filename, 'test1')
924
-
925
- # wbk = xlrd.open_workbook(filename,
926
- # formatting_info=True)
927
- # assert ["test1"] == wbk.sheet_names()
928
- # ws = wbk.sheet_by_name('test1')
929
- # assert [(0, 1, 5, 7), (0, 1, 3, 5), (0, 1, 1, 3)] == ws.merged_cells
930
- # for i in range(0, 2):
931
- # for j in range(0, 7):
932
- # xfx = ws.cell_xf_index(0, 0)
933
- # cell_xf = wbk.xf_list[xfx]
934
- # font = wbk.font_list
935
- # assert 1 == font[cell_xf.font_index].bold
936
- # assert 1 == cell_xf.border.top_line_style
937
- # assert 1 == cell_xf.border.right_line_style
938
- # assert 1 == cell_xf.border.bottom_line_style
939
- # assert 1 == cell_xf.border.left_line_style
940
- # assert 2 == cell_xf.alignment.hor_align
941
- # os.remove(filename)
942
- # def test_to_excel_header_styling_xlsx(self, engine, ext):
943
- # import StringIO
944
- # s = StringIO(
945
- # """Date,ticker,type,value
946
- # 2001-01-01,x,close,12.2
947
- # 2001-01-01,x,open ,12.1
948
- # 2001-01-01,y,close,12.2
949
- # 2001-01-01,y,open ,12.1
950
- # 2001-02-01,x,close,12.2
951
- # 2001-02-01,x,open ,12.1
952
- # 2001-02-01,y,close,12.2
953
- # 2001-02-01,y,open ,12.1
954
- # 2001-03-01,x,close,12.2
955
- # 2001-03-01,x,open ,12.1
956
- # 2001-03-01,y,close,12.2
957
- # 2001-03-01,y,open ,12.1""")
958
- # df = read_csv(s, parse_dates=["Date"])
959
- # pdf = df.pivot_table(values="value", rows=["ticker"],
960
- # cols=["Date", "type"])
961
- # try:
962
- # import openpyxl
963
- # from openpyxl.cell import get_column_letter
964
- # except ImportError:
965
- # pytest.skip
966
- # if openpyxl.__version__ < '1.6.1':
967
- # pytest.skip
968
- # # test xlsx_styling
969
- # filename = '__tmp_to_excel_header_styling_xlsx__.xlsx'
970
- # pdf.to_excel(filename, 'test1')
971
- # wbk = openpyxl.load_workbook(filename)
972
- # assert ["test1"] == wbk.get_sheet_names()
973
- # ws = wbk.get_sheet_by_name('test1')
974
- # xlsaddrs = ["%s2" % chr(i) for i in range(ord('A'), ord('H'))]
975
- # xlsaddrs += ["A%s" % i for i in range(1, 6)]
976
- # xlsaddrs += ["B1", "D1", "F1"]
977
- # for xlsaddr in xlsaddrs:
978
- # cell = ws.cell(xlsaddr)
979
- # assert cell.style.font.bold
980
- # assert (openpyxl.style.Border.BORDER_THIN ==
981
- # cell.style.borders.top.border_style)
982
- # assert (openpyxl.style.Border.BORDER_THIN ==
983
- # cell.style.borders.right.border_style)
984
- # assert (openpyxl.style.Border.BORDER_THIN ==
985
- # cell.style.borders.bottom.border_style)
986
- # assert (openpyxl.style.Border.BORDER_THIN ==
987
- # cell.style.borders.left.border_style)
988
- # assert (openpyxl.style.Alignment.HORIZONTAL_CENTER ==
989
- # cell.style.alignment.horizontal)
990
- # mergedcells_addrs = ["C1", "E1", "G1"]
991
- # for maddr in mergedcells_addrs:
992
- # assert ws.cell(maddr).merged
993
- # os.remove(filename)
994
-
995
894
@pytest .mark .parametrize ("use_headers" , [True , False ])
996
895
@pytest .mark .parametrize ("r_idx_nlevels" , [1 , 2 , 3 ])
997
896
@pytest .mark .parametrize ("c_idx_nlevels" , [1 , 2 , 3 ])
0 commit comments