|
36 | 36 | _mixed_frame['foo'] = 'bar'
|
37 | 37 |
|
38 | 38 |
|
39 |
| -@td.skip_if_no('xlrd', '0.9') |
| 39 | +@td.skip_if_no('xlrd', '1.0.0') |
40 | 40 | class SharedItems(object):
|
41 | 41 |
|
42 | 42 | @pytest.fixture(autouse=True)
|
@@ -796,35 +796,19 @@ def tdf(col_sheet_name):
|
796 | 796 | tm.assert_frame_equal(dfs[s], dfs_returned[s])
|
797 | 797 |
|
798 | 798 | def test_reader_seconds(self, ext):
|
799 |
| - import xlrd |
800 | 799 |
|
801 | 800 | # Test reading times with and without milliseconds. GH5945.
|
802 |
| - if LooseVersion(xlrd.__VERSION__) >= LooseVersion("0.9.3"): |
803 |
| - # Xlrd >= 0.9.3 can handle Excel milliseconds. |
804 |
| - expected = DataFrame.from_dict({"Time": [time(1, 2, 3), |
805 |
| - time(2, 45, 56, 100000), |
806 |
| - time(4, 29, 49, 200000), |
807 |
| - time(6, 13, 42, 300000), |
808 |
| - time(7, 57, 35, 400000), |
809 |
| - time(9, 41, 28, 500000), |
810 |
| - time(11, 25, 21, 600000), |
811 |
| - time(13, 9, 14, 700000), |
812 |
| - time(14, 53, 7, 800000), |
813 |
| - time(16, 37, 0, 900000), |
814 |
| - time(18, 20, 54)]}) |
815 |
| - else: |
816 |
| - # Xlrd < 0.9.3 rounds Excel milliseconds. |
817 |
| - expected = DataFrame.from_dict({"Time": [time(1, 2, 3), |
818 |
| - time(2, 45, 56), |
819 |
| - time(4, 29, 49), |
820 |
| - time(6, 13, 42), |
821 |
| - time(7, 57, 35), |
822 |
| - time(9, 41, 29), |
823 |
| - time(11, 25, 22), |
824 |
| - time(13, 9, 15), |
825 |
| - time(14, 53, 8), |
826 |
| - time(16, 37, 1), |
827 |
| - time(18, 20, 54)]}) |
| 801 | + expected = DataFrame.from_dict({"Time": [time(1, 2, 3), |
| 802 | + time(2, 45, 56, 100000), |
| 803 | + time(4, 29, 49, 200000), |
| 804 | + time(6, 13, 42, 300000), |
| 805 | + time(7, 57, 35, 400000), |
| 806 | + time(9, 41, 28, 500000), |
| 807 | + time(11, 25, 21, 600000), |
| 808 | + time(13, 9, 14, 700000), |
| 809 | + time(14, 53, 7, 800000), |
| 810 | + time(16, 37, 0, 900000), |
| 811 | + time(18, 20, 54)]}) |
828 | 812 |
|
829 | 813 | actual = self.get_exceldf('times_1900', ext, 'Sheet1')
|
830 | 814 | tm.assert_frame_equal(actual, expected)
|
|
0 commit comments