Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: mark tzlocal tests as slow, closes #34413 #34610

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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