23
23
from decimal import Decimal
24
24
import operator
25
25
import os
26
- from typing import List
27
26
28
27
from dateutil .tz import tzlocal , tzutc
29
28
import hypothesis
32
31
import pytest
33
32
from pytz import FixedOffset , utc
34
33
35
- from pandas ._typing import Dtype
36
34
import pandas .util ._test_decorators as td
37
35
38
36
import pandas as pd
@@ -864,39 +862,7 @@ def utc_fixture(request):
864
862
# ----------------------------------------------------------------
865
863
# Dtypes
866
864
# ----------------------------------------------------------------
867
-
868
- UNSIGNED_INT_DTYPES = ["uint8" , "uint16" , "uint32" , "uint64" ]
869
- UNSIGNED_EA_INT_DTYPES = ["UInt8" , "UInt16" , "UInt32" , "UInt64" ]
870
- SIGNED_INT_DTYPES : List [Dtype ] = [int , "int8" , "int16" , "int32" , "int64" ]
871
- SIGNED_EA_INT_DTYPES = ["Int8" , "Int16" , "Int32" , "Int64" ]
872
- ALL_INT_DTYPES = UNSIGNED_INT_DTYPES + SIGNED_INT_DTYPES
873
- ALL_EA_INT_DTYPES = UNSIGNED_EA_INT_DTYPES + SIGNED_EA_INT_DTYPES
874
-
875
- FLOAT_DTYPES : List [Dtype ] = [float , "float32" , "float64" ]
876
- COMPLEX_DTYPES : List [Dtype ] = [complex , "complex64" , "complex128" ]
877
- STRING_DTYPES : List [Dtype ] = [str , "str" , "U" ]
878
-
879
- DATETIME64_DTYPES = ["datetime64[ns]" , "M8[ns]" ]
880
- TIMEDELTA64_DTYPES = ["timedelta64[ns]" , "m8[ns]" ]
881
-
882
- BOOL_DTYPES = [bool , "bool" ]
883
- BYTES_DTYPES = [bytes , "bytes" ]
884
- OBJECT_DTYPES = [object , "object" ]
885
-
886
- ALL_REAL_DTYPES = FLOAT_DTYPES + ALL_INT_DTYPES
887
- ALL_NUMPY_DTYPES = (
888
- ALL_REAL_DTYPES
889
- + COMPLEX_DTYPES
890
- + STRING_DTYPES
891
- + DATETIME64_DTYPES
892
- + TIMEDELTA64_DTYPES
893
- + BOOL_DTYPES
894
- + OBJECT_DTYPES
895
- + BYTES_DTYPES
896
- )
897
-
898
-
899
- @pytest .fixture (params = STRING_DTYPES )
865
+ @pytest .fixture (params = tm .STRING_DTYPES )
900
866
def string_dtype (request ):
901
867
"""
902
868
Parametrized fixture for string dtypes.
@@ -908,7 +874,7 @@ def string_dtype(request):
908
874
return request .param
909
875
910
876
911
- @pytest .fixture (params = BYTES_DTYPES )
877
+ @pytest .fixture (params = tm . BYTES_DTYPES )
912
878
def bytes_dtype (request ):
913
879
"""
914
880
Parametrized fixture for bytes dtypes.
@@ -919,7 +885,7 @@ def bytes_dtype(request):
919
885
return request .param
920
886
921
887
922
- @pytest .fixture (params = OBJECT_DTYPES )
888
+ @pytest .fixture (params = tm . OBJECT_DTYPES )
923
889
def object_dtype (request ):
924
890
"""
925
891
Parametrized fixture for object dtypes.
@@ -930,7 +896,7 @@ def object_dtype(request):
930
896
return request .param
931
897
932
898
933
- @pytest .fixture (params = DATETIME64_DTYPES )
899
+ @pytest .fixture (params = tm . DATETIME64_DTYPES )
934
900
def datetime64_dtype (request ):
935
901
"""
936
902
Parametrized fixture for datetime64 dtypes.
@@ -941,7 +907,7 @@ def datetime64_dtype(request):
941
907
return request .param
942
908
943
909
944
- @pytest .fixture (params = TIMEDELTA64_DTYPES )
910
+ @pytest .fixture (params = tm . TIMEDELTA64_DTYPES )
945
911
def timedelta64_dtype (request ):
946
912
"""
947
913
Parametrized fixture for timedelta64 dtypes.
@@ -952,7 +918,7 @@ def timedelta64_dtype(request):
952
918
return request .param
953
919
954
920
955
- @pytest .fixture (params = FLOAT_DTYPES )
921
+ @pytest .fixture (params = tm . FLOAT_DTYPES )
956
922
def float_dtype (request ):
957
923
"""
958
924
Parameterized fixture for float dtypes.
@@ -964,7 +930,7 @@ def float_dtype(request):
964
930
return request .param
965
931
966
932
967
- @pytest .fixture (params = COMPLEX_DTYPES )
933
+ @pytest .fixture (params = tm . COMPLEX_DTYPES )
968
934
def complex_dtype (request ):
969
935
"""
970
936
Parameterized fixture for complex dtypes.
@@ -976,7 +942,7 @@ def complex_dtype(request):
976
942
return request .param
977
943
978
944
979
- @pytest .fixture (params = SIGNED_INT_DTYPES )
945
+ @pytest .fixture (params = tm . SIGNED_INT_DTYPES )
980
946
def sint_dtype (request ):
981
947
"""
982
948
Parameterized fixture for signed integer dtypes.
@@ -990,7 +956,7 @@ def sint_dtype(request):
990
956
return request .param
991
957
992
958
993
- @pytest .fixture (params = UNSIGNED_INT_DTYPES )
959
+ @pytest .fixture (params = tm . UNSIGNED_INT_DTYPES )
994
960
def uint_dtype (request ):
995
961
"""
996
962
Parameterized fixture for unsigned integer dtypes.
@@ -1003,7 +969,7 @@ def uint_dtype(request):
1003
969
return request .param
1004
970
1005
971
1006
- @pytest .fixture (params = ALL_INT_DTYPES )
972
+ @pytest .fixture (params = tm . ALL_INT_DTYPES )
1007
973
def any_int_dtype (request ):
1008
974
"""
1009
975
Parameterized fixture for any integer dtype.
@@ -1021,7 +987,7 @@ def any_int_dtype(request):
1021
987
return request .param
1022
988
1023
989
1024
- @pytest .fixture (params = ALL_EA_INT_DTYPES )
990
+ @pytest .fixture (params = tm . ALL_EA_INT_DTYPES )
1025
991
def any_nullable_int_dtype (request ):
1026
992
"""
1027
993
Parameterized fixture for any nullable integer dtype.
@@ -1038,7 +1004,7 @@ def any_nullable_int_dtype(request):
1038
1004
return request .param
1039
1005
1040
1006
1041
- @pytest .fixture (params = ALL_REAL_DTYPES )
1007
+ @pytest .fixture (params = tm . ALL_REAL_DTYPES )
1042
1008
def any_real_dtype (request ):
1043
1009
"""
1044
1010
Parameterized fixture for any (purely) real numeric dtype.
@@ -1059,7 +1025,7 @@ def any_real_dtype(request):
1059
1025
return request .param
1060
1026
1061
1027
1062
- @pytest .fixture (params = ALL_NUMPY_DTYPES )
1028
+ @pytest .fixture (params = tm . ALL_NUMPY_DTYPES )
1063
1029
def any_numpy_dtype (request ):
1064
1030
"""
1065
1031
Parameterized fixture for all numpy dtypes.
0 commit comments