Skip to content

Commit 591a455

Browse files
remove expected warnings in tests
1 parent 8e58fa6 commit 591a455

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

pandas/tests/dtypes/test_missing.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from contextlib import nullcontext
21
from datetime import datetime
32
from decimal import Decimal
43

@@ -7,7 +6,6 @@
76

87
from pandas._libs import missing as libmissing
98
from pandas._libs.tslibs import iNaT
10-
from pandas.compat.numpy import np_version_gte1p25
119

1210
from pandas.core.dtypes.common import (
1311
is_float,
@@ -458,15 +456,7 @@ def test_array_equivalent_dti(dtype_equal):
458456
)
459457
def test_array_equivalent_series(val):
460458
arr = np.array([1, 2])
461-
msg = "elementwise comparison failed"
462-
cm = (
463-
# stacklevel is chosen to make sense when called from .equals
464-
tm.assert_produces_warning(FutureWarning, match=msg, check_stacklevel=False)
465-
if isinstance(val, str) and not np_version_gte1p25
466-
else nullcontext()
467-
)
468-
with cm:
469-
assert not array_equivalent(Series([arr, arr]), Series([arr, val]))
459+
assert not array_equivalent(Series([arr, arr]), Series([arr, val]))
470460

471461

472462
def test_array_equivalent_array_mismatched_shape():

pandas/tests/series/methods/test_equals.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
from contextlib import nullcontext
21
import copy
32

43
import numpy as np
54
import pytest
65

76
from pandas._libs.missing import is_matching_na
8-
from pandas.compat.numpy import np_version_gte1p25
97

108
from pandas.core.dtypes.common import is_float
119

@@ -14,7 +12,6 @@
1412
MultiIndex,
1513
Series,
1614
)
17-
import pandas._testing as tm
1815

1916

2017
@pytest.mark.parametrize(
@@ -48,14 +45,7 @@ def test_equals_list_array(val):
4845
assert s1.equals(s2)
4946

5047
s1[1] = val
51-
52-
cm = (
53-
tm.assert_produces_warning(FutureWarning, check_stacklevel=False)
54-
if isinstance(val, str) and not np_version_gte1p25
55-
else nullcontext()
56-
)
57-
with cm:
58-
assert not s1.equals(s2)
48+
assert not s1.equals(s2)
5949

6050

6151
def test_equals_false_negative():

0 commit comments

Comments
 (0)