16
16
)
17
17
from pandas .core .groupby .generic import SeriesGroupBy
18
18
from pandas .core .resample import Resampler
19
- import pytest
20
19
from typing_extensions import assert_type
21
20
22
21
from pandas ._typing import Scalar
23
22
24
- from tests import check
23
+ from tests import (
24
+ check ,
25
+ pytest_warns_bounded ,
26
+ )
25
27
26
28
DR = date_range ("1999-1-1" , periods = 365 , freq = "D" )
27
29
DF_ = DataFrame (np .random .standard_normal ((365 , 1 )), index = DR )
@@ -298,7 +300,9 @@ def s2scalar(val: Series) -> float:
298
300
299
301
check (S .resample ("m" ).aggregate (np .sum ), Series )
300
302
check (S .resample ("m" ).aggregate ("sum" ), Series )
301
- with pytest .warns (FutureWarning , match = "Not prepending group keys" ):
303
+ with pytest_warns_bounded (
304
+ FutureWarning , match = "Not prepending group keys" , upper = "1.5.99"
305
+ ):
302
306
check (S .resample ("m" ).aggregate (s2series ), Series )
303
307
check (S .resample ("m" ).aggregate (s2scalar ), Series )
304
308
check (S .resample ("m" ).aggregate ([np .mean ]), DataFrame )
@@ -319,7 +323,9 @@ def df2scalar(val: DataFrame) -> float:
319
323
320
324
check (DF .resample ("m" ).aggregate (np .sum ), DataFrame )
321
325
check (DF .resample ("m" ).aggregate ("sum" ), DataFrame )
322
- with pytest .warns (FutureWarning , match = "Not prepending group keys" ):
326
+ with pytest_warns_bounded (
327
+ FutureWarning , match = "Not prepending group keys" , upper = "1.5.99"
328
+ ):
323
329
check (DF .resample ("m" ).aggregate (df2frame ), DataFrame )
324
330
check (DF .resample ("m" ).aggregate (df2series ), DataFrame )
325
331
check (DF .resample ("m" ).aggregate (df2scalar ), DataFrame )
0 commit comments