Skip to content

Commit 87b1ba5

Browse files
committed
revert warnings filtering in tests
1 parent 7c533a1 commit 87b1ba5

File tree

1 file changed

+32
-44
lines changed

1 file changed

+32
-44
lines changed

pandas/tests/frame/methods/test_asof.py

+32-44
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import warnings
2-
31
import numpy as np
42
import pytest
53

@@ -26,18 +24,15 @@ def test_basic(self, date_range_frame):
2624
df.loc[15:30, "A"] = np.nan
2725
dates = date_range("1/1/1990", periods=N * 3, freq="25s")
2826

29-
with warnings.catch_warnings():
30-
warnings.simplefilter("ignore", FutureWarning)
31-
32-
result = df.asof(dates)
33-
assert result.notna().all(1).all()
34-
lb = df.index[14]
35-
ub = df.index[30]
27+
result = df.asof(dates)
28+
assert result.notna().all(1).all()
29+
lb = df.index[14]
30+
ub = df.index[30]
3631

37-
dates = list(dates)
32+
dates = list(dates)
3833

39-
result = df.asof(dates)
40-
assert result.notna().all(1).all()
34+
result = df.asof(dates)
35+
assert result.notna().all(1).all()
4136

4237
mask = (result.index >= lb) & (result.index < ub)
4338
rs = result[mask]
@@ -49,46 +44,41 @@ def test_subset(self, date_range_frame):
4944
df.loc[4:8, "A"] = np.nan
5045
dates = date_range("1/1/1990", periods=N * 3, freq="25s")
5146

52-
with warnings.catch_warnings():
53-
warnings.simplefilter("ignore", FutureWarning)
54-
55-
# with a subset of A should be the same
56-
result = df.asof(dates, subset="A")
57-
expected = df.asof(dates)
58-
tm.assert_frame_equal(result, expected)
47+
# with a subset of A should be the same
48+
result = df.asof(dates, subset="A")
49+
expected = df.asof(dates)
50+
tm.assert_frame_equal(result, expected)
5951

60-
# same with A/B
61-
result = df.asof(dates, subset=["A", "B"])
62-
expected = df.asof(dates)
63-
tm.assert_frame_equal(result, expected)
52+
# same with A/B
53+
result = df.asof(dates, subset=["A", "B"])
54+
expected = df.asof(dates)
55+
tm.assert_frame_equal(result, expected)
6456

65-
# B gives df.asof
66-
result = df.asof(dates, subset="B")
67-
expected = df.resample("25s", closed="right").ffill().reindex(dates)
68-
expected.iloc[20:] = 9
57+
# B gives df.asof
58+
result = df.asof(dates, subset="B")
59+
expected = df.resample("25s", closed="right").ffill().reindex(dates)
60+
expected.iloc[20:] = 9
6961

70-
tm.assert_frame_equal(result, expected)
62+
tm.assert_frame_equal(result, expected)
7163

7264
def test_missing(self, date_range_frame):
7365
# GH 15118
7466
# no match found - `where` value before earliest date in index
7567
N = 10
7668
df = date_range_frame.iloc[:N].copy()
77-
with warnings.catch_warnings():
78-
warnings.simplefilter("ignore", FutureWarning)
7969

80-
result = df.asof("1989-12-31")
70+
result = df.asof("1989-12-31")
8171

82-
expected = Series(
83-
index=["A", "B"], name=Timestamp("1989-12-31"), dtype=np.float64
84-
)
85-
tm.assert_series_equal(result, expected)
72+
expected = Series(
73+
index=["A", "B"], name=Timestamp("1989-12-31"), dtype=np.float64
74+
)
75+
tm.assert_series_equal(result, expected)
8676

87-
result = df.asof(to_datetime(["1989-12-31"]))
88-
expected = DataFrame(
89-
index=to_datetime(["1989-12-31"]), columns=["A", "B"], dtype="float64"
90-
)
91-
tm.assert_frame_equal(result, expected)
77+
result = df.asof(to_datetime(["1989-12-31"]))
78+
expected = DataFrame(
79+
index=to_datetime(["1989-12-31"]), columns=["A", "B"], dtype="float64"
80+
)
81+
tm.assert_frame_equal(result, expected)
9282

9383
def test_all_nans(self, date_range_frame):
9484
# GH 15713
@@ -144,8 +134,6 @@ def test_time_zone_aware_index(self, stamp, expected):
144134
Timestamp("2018-01-01 22:35:10.550+00:00"),
145135
],
146136
)
147-
with warnings.catch_warnings():
148-
warnings.simplefilter("ignore", FutureWarning)
149137

150-
result = df.asof(stamp)
151-
tm.assert_series_equal(result, expected)
138+
result = df.asof(stamp)
139+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)