Skip to content

Commit 2c052f7

Browse files
authored
TST: mark tzlocal tests as slow, closes #34413 (#34610)
1 parent 36a86d2 commit 2c052f7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pandas/tests/resample/test_datetime_index.py

+20
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from functools import partial
33
from io import StringIO
44

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

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

490496

497+
@pytest.mark.slow
498+
@pytest.mark.parametrize("freq", ["Y", "10M"])
499+
def test_nearest_upsample_with_limit_tzlocal(freq):
500+
# GH#33939, GH#34413 split off from test_nearest_upsample_with_limit
501+
rule = "30S"
502+
tz = tzlocal()
503+
rng = date_range("1/1/2000", periods=3, freq=freq, tz=tz)
504+
ts = Series(np.random.randn(len(rng)), rng)
505+
506+
result = ts.resample(rule).nearest(limit=2)
507+
expected = ts.reindex(result.index, method="nearest", limit=2)
508+
tm.assert_series_equal(result, expected)
509+
510+
491511
def test_resample_ohlc(series):
492512
s = series
493513

0 commit comments

Comments
 (0)