Skip to content

Commit d968260

Browse files
authored
TST: only catch deprecation warnings for top-level module imports (#15718)
1 parent 2c3f808 commit d968260

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

pandas/tests/api/test_api.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,31 +249,26 @@ def test_groupby(self):
249249
class TestJson(tm.TestCase):
250250

251251
def test_deprecation_access_func(self):
252-
with tm.assert_produces_warning(FutureWarning,
253-
check_stacklevel=False):
252+
with catch_warnings(record=True):
254253
pd.json.dumps([])
255254

256255

257256
class TestParser(tm.TestCase):
258257

259258
def test_deprecation_access_func(self):
260-
with tm.assert_produces_warning(FutureWarning,
261-
check_stacklevel=False):
259+
with catch_warnings(record=True):
262260
pd.parser.na_values
263261

264262

265263
class TestLib(tm.TestCase):
266264

267265
def test_deprecation_access_func(self):
268-
with tm.assert_produces_warning(FutureWarning,
269-
check_stacklevel=False):
266+
with catch_warnings(record=True):
270267
pd.lib.infer_dtype
271268

272269

273270
class TestTSLib(tm.TestCase):
274271

275272
def test_deprecation_access_func(self):
276-
# some libraries may be imported before we
277-
# test and could show the warning
278273
with catch_warnings(record=True):
279274
pd.tslib.Timestamp

0 commit comments

Comments
 (0)