Skip to content

Commit

Permalink
TST: mark tzlocal tests as slow, closes #34413 (#34610)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored Jun 8, 2020
1 parent 36a86d2 commit 2c052f7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pandas/tests/resample/test_datetime_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from functools import partial
from io import StringIO

from dateutil.tz import tzlocal
import numpy as np
import pytest
import pytz
Expand Down Expand Up @@ -480,6 +481,11 @@ def test_upsample_with_limit():
@pytest.mark.parametrize("rule", ["Y", "3M", "15D", "30H", "15Min", "30S"])
def test_nearest_upsample_with_limit(tz_aware_fixture, freq, rule):
# GH 33939
tz = tz_aware_fixture
if str(tz) == "tzlocal()" and rule == "30S" and freq in ["Y", "10M"]:
# GH#34413 separate these so we can mark as slow, see
# test_nearest_upsample_with_limit_tzlocal
return
rng = date_range("1/1/2000", periods=3, freq=freq, tz=tz_aware_fixture)
ts = Series(np.random.randn(len(rng)), rng)

Expand All @@ -488,6 +494,20 @@ def test_nearest_upsample_with_limit(tz_aware_fixture, freq, rule):
tm.assert_series_equal(result, expected)


@pytest.mark.slow
@pytest.mark.parametrize("freq", ["Y", "10M"])
def test_nearest_upsample_with_limit_tzlocal(freq):
# GH#33939, GH#34413 split off from test_nearest_upsample_with_limit
rule = "30S"
tz = tzlocal()
rng = date_range("1/1/2000", periods=3, freq=freq, tz=tz)
ts = Series(np.random.randn(len(rng)), rng)

result = ts.resample(rule).nearest(limit=2)
expected = ts.reindex(result.index, method="nearest", limit=2)
tm.assert_series_equal(result, expected)


def test_resample_ohlc(series):
s = series

Expand Down

0 comments on commit 2c052f7

Please sign in to comment.