|
11 | 11 |
|
12 | 12 | import warnings
|
13 | 13 | import numpy as np
|
14 |
| -from hypothesis import given, settings |
15 |
| -from hypothesis.strategies import composite, dates, integers, sampled_from |
16 | 14 |
|
17 | 15 | from pandas import (notna, DataFrame, Series, MultiIndex, date_range,
|
18 | 16 | Timestamp, compat)
|
@@ -823,20 +821,6 @@ def zip_frames(frames, axis=1):
|
823 | 821 | return pd.DataFrame(zipped)
|
824 | 822 |
|
825 | 823 |
|
826 |
| -@composite |
827 |
| -def indices(draw, max_length=5): |
828 |
| - date = draw( |
829 |
| - dates( |
830 |
| - min_value=Timestamp.min.ceil("D").to_pydatetime().date(), |
831 |
| - max_value=Timestamp.max.floor("D").to_pydatetime().date(), |
832 |
| - ).map(Timestamp) |
833 |
| - ) |
834 |
| - periods = draw(integers(0, max_length)) |
835 |
| - freq = draw(sampled_from(list("BDHTS"))) |
836 |
| - dr = date_range(date, periods=periods, freq=freq) |
837 |
| - return pd.DatetimeIndex(list(dr)) |
838 |
| - |
839 |
| - |
840 | 824 | class TestDataFrameAggregate():
|
841 | 825 |
|
842 | 826 | def test_agg_transform(self, axis, float_frame):
|
@@ -1156,11 +1140,10 @@ def test_agg_cython_table_raises(self, df, func, expected, axis):
|
1156 | 1140 | with pytest.raises(expected):
|
1157 | 1141 | df.agg(func, axis=axis)
|
1158 | 1142 |
|
1159 |
| - @given(index=indices(max_length=5), num_columns=integers(0, 5)) |
1160 |
| - @settings(deadline=1000) |
1161 |
| - def test_frequency_is_original(self, index, num_columns): |
1162 |
| - # GH 22150 |
| 1143 | + @pytest.mark.parametrize("num_cols", [2, 3, 5]) |
| 1144 | + def test_frequency_is_original(self, num_cols): |
| 1145 | + index = pd.DatetimeIndex(["1950-06-30", "1952-10-24", "1953-05-29"]) |
1163 | 1146 | original = index.copy()
|
1164 |
| - df = DataFrame(True, index=index, columns=range(num_columns)) |
| 1147 | + df = DataFrame(1, index=index, columns=range(num_cols)) |
1165 | 1148 | df.apply(lambda x: x)
|
1166 | 1149 | assert index.freq == original.freq
|
0 commit comments