Skip to content

Commit

Permalink
Use simpler warning ignore
Browse files Browse the repository at this point in the history
Co-authored-by: Marten van Kerkwijk <mhvk@astro.utoronto.ca>
  • Loading branch information
pllim and mhvk committed Nov 30, 2022
1 parent 2fc31f0 commit c9bd023
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions astropy/table/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pathlib
import pickle
import sys
import warnings
from collections import OrderedDict
from io import StringIO

Expand Down Expand Up @@ -2159,14 +2158,9 @@ def test_masking(self, use_nullable_int):
else:
assert t2[name].dtype.kind == "i"

with warnings.catch_warnings():
# This warning pops up when use_nullable_int is False
# for pandas 1.5.2.
warnings.filterwarnings(
"ignore",
message="invalid value encountered in cast",
category=RuntimeWarning,
)
# This warning pops up when use_nullable_int is False
# for pandas 1.5.2.
with np.errstate(invalid='ignore'):
assert_array_equal(column.data, t2[name].data.astype(column.dtype))
else:
if column.dtype.byteorder in ("=", "|"):
Expand Down

0 comments on commit c9bd023

Please sign in to comment.