From aa2a6182012fc9e6f8d03ef3dae0874c60522e9d Mon Sep 17 00:00:00 2001 From: alimcmaster1 Date: Sun, 16 Dec 2018 11:53:14 +0000 Subject: [PATCH 1/2] Fix flakey test --- pandas/tests/frame/test_apply.py | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/pandas/tests/frame/test_apply.py b/pandas/tests/frame/test_apply.py index a3b72d223f957..6460e5a1cd40b 100644 --- a/pandas/tests/frame/test_apply.py +++ b/pandas/tests/frame/test_apply.py @@ -823,20 +823,6 @@ def zip_frames(frames, axis=1): return pd.DataFrame(zipped) -@composite -def indices(draw, max_length=5): - date = draw( - dates( - min_value=Timestamp.min.ceil("D").to_pydatetime().date(), - max_value=Timestamp.max.floor("D").to_pydatetime().date(), - ).map(Timestamp) - ) - periods = draw(integers(0, max_length)) - freq = draw(sampled_from(list("BDHTS"))) - dr = date_range(date, periods=periods, freq=freq) - return pd.DatetimeIndex(list(dr)) - - class TestDataFrameAggregate(): def test_agg_transform(self, axis, float_frame): @@ -1156,11 +1142,10 @@ def test_agg_cython_table_raises(self, df, func, expected, axis): with pytest.raises(expected): df.agg(func, axis=axis) - @given(index=indices(max_length=5), num_columns=integers(0, 5)) - @settings(deadline=1000) - def test_frequency_is_original(self, index, num_columns): - # GH 22150 + @pytest.mark.parametrize("num_cols", [2, 3, 5]) + def test_frequency_is_original(self, num_cols): + index = pd.DatetimeIndex(["1950-06-30", "1952-10-24", "1953-05-29"]) original = index.copy() - df = DataFrame(True, index=index, columns=range(num_columns)) + df = DataFrame(1, index=index, columns=range(num_cols)) df.apply(lambda x: x) assert index.freq == original.freq From 70bab10eaec5bbae52eee5e621e3c39e2e8fdde5 Mon Sep 17 00:00:00 2001 From: alimcmaster1 Date: Sun, 16 Dec 2018 18:16:52 +0000 Subject: [PATCH 2/2] Fix flakey test --- pandas/tests/frame/test_apply.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandas/tests/frame/test_apply.py b/pandas/tests/frame/test_apply.py index 6460e5a1cd40b..4c8268f02b211 100644 --- a/pandas/tests/frame/test_apply.py +++ b/pandas/tests/frame/test_apply.py @@ -11,8 +11,6 @@ import warnings import numpy as np -from hypothesis import given, settings -from hypothesis.strategies import composite, dates, integers, sampled_from from pandas import (notna, DataFrame, Series, MultiIndex, date_range, Timestamp, compat)