@@ -57,28 +57,28 @@ def test_to_numpy_python_types_numeric(data, expected_dtype):
57
57
#
58
58
# Reference: https://numpy.org/doc/2.1/reference/arrays.scalars.html
59
59
########################################################################################
60
- @ pytest . mark . parametrize (
61
- ( "dtype" , "expected_dtype " ),
62
- [
63
- pytest .param (np .int8 , np .int8 , id = "int8 " ),
64
- pytest .param (np .int16 , np .int16 , id = "int16 " ),
65
- pytest .param (np .int32 , np .int32 , id = "int32 " ),
66
- pytest .param (np .int64 , np .int64 , id = "int64 " ),
67
- pytest .param (np .longlong , np .longlong , id = "longlong " ),
68
- pytest .param (np .uint8 , np .uint8 , id = "uint8 " ),
69
- pytest .param (np .uint16 , np .uint16 , id = "uint16 " ),
70
- pytest .param (np .uint32 , np .uint32 , id = "uint32 " ),
71
- pytest .param (np .uint64 , np .uint64 , id = "uint64 " ),
72
- pytest .param (np .ulonglong , np .ulonglong , id = "ulonglong " ),
73
- pytest .param (np .float16 , np .float16 , id = "float16 " ),
74
- pytest .param (np .float32 , np .float32 , id = "float32 " ),
75
- pytest .param (np .float64 , np .float64 , id = "float64 " ),
76
- pytest .param (np .longdouble , np .longdouble , id = "longdouble " ),
77
- pytest .param (np .complex64 , np .complex64 , id = "complex64 " ),
78
- pytest . param ( np . complex128 , np . complex128 , id = "complex128" ),
79
- pytest . param ( np . clongdouble , np . clongdouble , id = "clongdouble" ),
80
- ],
81
- )
60
+ np_dtype_params = [
61
+ pytest . param ( np . int8 , np . int8 , id = "int8 " ),
62
+ pytest . param ( np . int16 , np . int16 , id = "int16" ),
63
+ pytest .param (np .int32 , np .int32 , id = "int32 " ),
64
+ pytest .param (np .int64 , np .int64 , id = "int64 " ),
65
+ pytest .param (np .longlong , np .longlong , id = "longlong " ),
66
+ pytest .param (np .uint8 , np .uint8 , id = "uint8 " ),
67
+ pytest .param (np .uint16 , np .uint16 , id = "uint16 " ),
68
+ pytest .param (np .uint32 , np .uint32 , id = "uint32 " ),
69
+ pytest .param (np .uint64 , np .uint64 , id = "uint64 " ),
70
+ pytest .param (np .ulonglong , np .ulonglong , id = "ulonglong " ),
71
+ pytest .param (np .float16 , np .float16 , id = "float16 " ),
72
+ pytest .param (np .float32 , np .float32 , id = "float32 " ),
73
+ pytest .param (np .float64 , np .float64 , id = "float64 " ),
74
+ pytest .param (np .longdouble , np .longdouble , id = "longdouble " ),
75
+ pytest .param (np .complex64 , np .complex64 , id = "complex64 " ),
76
+ pytest .param (np .complex128 , np .complex128 , id = "complex128 " ),
77
+ pytest .param (np .clongdouble , np .clongdouble , id = "clongdouble " ),
78
+ ]
79
+
80
+
81
+ @ pytest . mark . parametrize (( "dtype" , "expected_dtype" ), np_dtype_params )
82
82
def test_to_numpy_ndarray_numpy_dtypes_numeric (dtype , expected_dtype ):
83
83
"""
84
84
Test the _to_numpy function with NumPy arrays of NumPy numeric dtypes.
@@ -127,28 +127,7 @@ def test_to_numpy_ndarray_numpy_dtypes_numeric(dtype, expected_dtype):
127
127
# 2. https://pandas.pydata.org/docs/user_guide/basics.html#basics-dtypes
128
128
# 3. https://pandas.pydata.org/docs/user_guide/pyarrow.html
129
129
########################################################################################
130
- @pytest .mark .parametrize (
131
- ("dtype" , "expected_dtype" ),
132
- [
133
- pytest .param (np .int8 , np .int8 , id = "int8" ),
134
- pytest .param (np .int16 , np .int16 , id = "int16" ),
135
- pytest .param (np .int32 , np .int32 , id = "int32" ),
136
- pytest .param (np .int64 , np .int64 , id = "int64" ),
137
- pytest .param (np .longlong , np .longlong , id = "longlong" ),
138
- pytest .param (np .uint8 , np .uint8 , id = "uint8" ),
139
- pytest .param (np .uint16 , np .uint16 , id = "uint16" ),
140
- pytest .param (np .uint32 , np .uint32 , id = "uint32" ),
141
- pytest .param (np .uint64 , np .uint64 , id = "uint64" ),
142
- pytest .param (np .ulonglong , np .ulonglong , id = "ulonglong" ),
143
- pytest .param (np .float16 , np .float16 , id = "float16" ),
144
- pytest .param (np .float32 , np .float32 , id = "float32" ),
145
- pytest .param (np .float64 , np .float64 , id = "float64" ),
146
- pytest .param (np .longdouble , np .longdouble , id = "longdouble" ),
147
- pytest .param (np .complex64 , np .complex64 , id = "complex64" ),
148
- pytest .param (np .complex128 , np .complex128 , id = "complex128" ),
149
- pytest .param (np .clongdouble , np .clongdouble , id = "clongdouble" ),
150
- ],
151
- )
130
+ @pytest .mark .parametrize (("dtype" , "expected_dtype" ), np_dtype_params )
152
131
def test_to_numpy_pandas_series_numpy_dtypes_numeric (dtype , expected_dtype ):
153
132
"""
154
133
Test the _to_numpy function with pandas.Series of NumPy numeric dtypes.
0 commit comments