Skip to content

Commit 8a24f0d

Browse files
committed
add tests for nan-likes
1 parent 92604e9 commit 8a24f0d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pandas/tests/extension/base/interface.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ def test_can_hold_na_valid(self, data):
3131

3232
def test_contains(self, data):
3333
# GH-37867
34+
35+
data = data[~data.isna()]
36+
37+
scalar = data[0]
38+
39+
assert scalar in data
40+
assert "124jhujbhjhb5" not in data
41+
42+
na_value = data.dtype.na_value
43+
44+
assert na_value not in data
45+
46+
for na_value_type in {None, np.nan, pd.NA, pd.NaT}:
47+
assert na_value_type not in data
48+
49+
def test_contains_nan(self, data_missing):
50+
# GH-37867
51+
data = data_missing
52+
3453
scalar = data[~data.isna()][0]
3554

3655
assert scalar in data

0 commit comments

Comments
 (0)