Skip to content

Commit afe6e84

Browse files
adjusting isinstance checks to use the ABC versions
1 parent 54630a8 commit afe6e84

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/tests/base/test_ops.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
is_object_dtype,
1919
needs_i8_conversion,
2020
)
21+
from pandas.core.dtypes.generic import ABCIndex, ABCMultiIndex
2122

2223
import pandas as pd
2324
from pandas import (
@@ -727,12 +728,12 @@ def test_fillna(self, index_or_series_obj):
727728
obj = index_or_series_obj
728729
if len(obj) == 0:
729730
pytest.skip("Test doesn't make sense on empty data")
730-
elif isinstance(obj, pd.MultiIndex):
731+
elif isinstance(obj, ABCMultiIndex):
731732
pytest.skip("MultiIndex doesn't support isna")
732733

733734
# values will not be changed
734735
result = obj.fillna(obj.values[0])
735-
if isinstance(obj, Index):
736+
if isinstance(obj, ABCIndex):
736737
tm.assert_index_equal(obj, result)
737738
else:
738739
tm.assert_series_equal(obj, result)
@@ -752,7 +753,7 @@ def test_fillna_null(self, null_obj, index_or_series_obj):
752753
pytest.skip(f"{klass} doesn't allow for NA operations")
753754
elif len(obj) < 1:
754755
pytest.skip("Test doesn't make sense on empty data")
755-
elif isinstance(obj, pd.MultiIndex):
756+
elif isinstance(obj, ABCMultiIndex):
756757
pytest.skip(f"MultiIndex can't hold '{null_obj}'")
757758

758759
values = obj.values
@@ -769,7 +770,7 @@ def test_fillna_null(self, null_obj, index_or_series_obj):
769770
obj = klass(values)
770771

771772
result = obj.fillna(fill_value)
772-
if isinstance(obj, Index):
773+
if isinstance(obj, ABCIndex):
773774
tm.assert_index_equal(result, expected)
774775
else:
775776
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)