diff --git a/pandas/_testing/__init__.py b/pandas/_testing/__init__.py index dac949f69bfaf..4742348b209d9 100644 --- a/pandas/_testing/__init__.py +++ b/pandas/_testing/__init__.py @@ -133,8 +133,10 @@ ALL_INT_EA_DTYPES = UNSIGNED_INT_EA_DTYPES + SIGNED_INT_EA_DTYPES ALL_INT_DTYPES: list[Dtype] = [*ALL_INT_NUMPY_DTYPES, *ALL_INT_EA_DTYPES] -FLOAT_NUMPY_DTYPES: list[Dtype] = [float, "float32", "float64"] +FLOAT_NUMPY_DTYPES: list[NpDtype] = [float, "float32", "float64"] FLOAT_EA_DTYPES: list[Dtype] = ["Float32", "Float64"] +ALL_FLOAT_DTYPES: list[Dtype] = [*FLOAT_NUMPY_DTYPES, *FLOAT_EA_DTYPES] + COMPLEX_DTYPES: list[Dtype] = [complex, "complex64", "complex128"] STRING_DTYPES: list[Dtype] = [str, "str", "U"] @@ -146,6 +148,10 @@ OBJECT_DTYPES: list[Dtype] = [object, "object"] ALL_REAL_NUMPY_DTYPES = FLOAT_NUMPY_DTYPES + ALL_INT_NUMPY_DTYPES +ALL_REAL_EXTENSION_DTYPES = FLOAT_EA_DTYPES + ALL_INT_EA_DTYPES +ALL_REAL_DTYPES: list[Dtype] = [*ALL_REAL_NUMPY_DTYPES, *ALL_REAL_EXTENSION_DTYPES] +ALL_NUMERIC_DTYPES: list[Dtype] = [*ALL_REAL_DTYPES, *COMPLEX_DTYPES] + ALL_NUMPY_DTYPES = ( ALL_REAL_NUMPY_DTYPES + COMPLEX_DTYPES diff --git a/pandas/conftest.py b/pandas/conftest.py index 4d0354a2aab04..2c410bb98b506 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -1409,7 +1409,7 @@ def float_ea_dtype(request): return request.param -@pytest.fixture(params=tm.FLOAT_NUMPY_DTYPES + tm.FLOAT_EA_DTYPES) +@pytest.fixture(params=tm.ALL_FLOAT_DTYPES) def any_float_dtype(request): """ Parameterized fixture for float dtypes. @@ -1614,9 +1614,7 @@ def any_real_numpy_dtype(request): return request.param -@pytest.fixture( - params=tm.ALL_REAL_NUMPY_DTYPES + tm.ALL_INT_EA_DTYPES + tm.FLOAT_EA_DTYPES -) +@pytest.fixture(params=tm.ALL_REAL_DTYPES) def any_real_numeric_dtype(request): """ Parameterized fixture for any (purely) real numeric dtype. @@ -1676,12 +1674,7 @@ def any_numpy_dtype(request): return request.param -@pytest.fixture( - params=tm.ALL_REAL_NUMPY_DTYPES - + tm.COMPLEX_DTYPES - + tm.ALL_INT_EA_DTYPES - + tm.FLOAT_EA_DTYPES -) +@pytest.fixture(params=tm.ALL_NUMERIC_DTYPES) def any_numeric_dtype(request): """ Parameterized fixture for all numeric dtypes. diff --git a/pandas/tests/frame/test_constructors.py b/pandas/tests/frame/test_constructors.py index e009ba45514a2..c621e9bae78f8 100644 --- a/pandas/tests/frame/test_constructors.py +++ b/pandas/tests/frame/test_constructors.py @@ -2262,10 +2262,7 @@ def test_constructor_categorical_series(self): @pytest.mark.parametrize( "dtype", - tm.ALL_INT_NUMPY_DTYPES - + tm.ALL_INT_EA_DTYPES - + tm.FLOAT_NUMPY_DTYPES - + tm.COMPLEX_DTYPES + tm.ALL_NUMERIC_DTYPES + tm.DATETIME64_DTYPES + tm.TIMEDELTA64_DTYPES + tm.BOOL_DTYPES,