diff --git a/pandas/tests/dtypes/test_common.py b/pandas/tests/dtypes/test_common.py index be5cb81506efd..15f3f7d608deb 100644 --- a/pandas/tests/dtypes/test_common.py +++ b/pandas/tests/dtypes/test_common.py @@ -20,6 +20,7 @@ import pandas as pd import pandas._testing as tm +from pandas.api.types import pandas_dtype from pandas.arrays import SparseArray @@ -400,6 +401,23 @@ def test_is_int64_dtype(dtype): assert com.is_int64_dtype(dtype) +def test_type_comparison_with_numeric_ea_dtype(any_numeric_ea_dtype): + # GH#43038 + assert pandas_dtype(any_numeric_ea_dtype) == any_numeric_ea_dtype + + +def test_type_comparison_with_real_numpy_dtype(any_real_numpy_dtype): + # GH#43038 + assert pandas_dtype(any_real_numpy_dtype) == any_real_numpy_dtype + + +def test_type_comparison_with_signed_int_ea_dtype_and_signed_int_numpy_dtype( + any_signed_int_ea_dtype, any_signed_int_numpy_dtype +): + # GH#43038 + assert not pandas_dtype(any_signed_int_ea_dtype) == any_signed_int_numpy_dtype + + @pytest.mark.parametrize( "dtype", [