MCPcopy
hub / github.com/pandas-dev/pandas / test_reader_seconds

Method test_reader_seconds

pandas/tests/io/excel/test_readers.py:998–1032  ·  view source on GitHub ↗
(self, request, engine, read_ext)

Source from the content-addressed store, hash-verified

996 f.read()
997
998 def test_reader_seconds(self, request, engine, read_ext):
999 xfail_datetimes_with_pyxlsb(engine, request)
1000
1001 # GH 55045
1002 if engine == "calamine" and read_ext == ".ods":
1003 request.applymarker(
1004 pytest.mark.xfail(
1005 reason="ODS file contains bad datetime (seconds as text)"
1006 )
1007 )
1008
1009 # Test reading times with and without milliseconds. GH5945.
1010 expected = DataFrame.from_dict(
1011 {
1012 "Time": [
1013 time(1, 2, 3),
1014 time(2, 45, 56, 100000),
1015 time(4, 29, 49, 200000),
1016 time(6, 13, 42, 300000),
1017 time(7, 57, 35, 400000),
1018 time(9, 41, 28, 500000),
1019 time(11, 25, 21, 600000),
1020 time(13, 9, 14, 700000),
1021 time(14, 53, 7, 800000),
1022 time(16, 37, 0, 900000),
1023 time(18, 20, 54),
1024 ]
1025 }
1026 )
1027
1028 actual = pd.read_excel("times_1900" + read_ext, sheet_name="Sheet1")
1029 tm.assert_frame_equal(actual, expected)
1030
1031 actual = pd.read_excel("times_1904" + read_ext, sheet_name="Sheet1")
1032 tm.assert_frame_equal(actual, expected)
1033
1034 def test_read_excel_multiindex(self, request, engine, read_ext):
1035 # see gh-4679

Callers

nothing calls this directly

Calls 2

from_dictMethod · 0.80

Tested by

no test coverage detected