Skip to content

Commit 7a1c7f2

Browse files
committed
TST/CI: fix 32bit dtype tests pandas-dev#36579, pandas-dev#32709
1 parent 6a10fb4 commit 7a1c7f2

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

pandas/tests/arrays/floating/test_function.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import numpy as np
22
import pytest
33

4+
from pandas.compat import IS64
5+
46
import pandas as pd
57
import pandas._testing as tm
68

@@ -82,10 +84,15 @@ def test_ufunc_reduce_raises(values):
8284
],
8385
)
8486
def test_stat_method(pandasmethname, kwargs):
85-
s = pd.Series(data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, np.nan, np.nan], dtype="Float64")
87+
s = pd.Series(
88+
data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, np.nan, np.nan],
89+
dtype="Float64" if IS64 else "Float32",
90+
)
8691
pandasmeth = getattr(s, pandasmethname)
8792
result = pandasmeth(**kwargs)
88-
s2 = pd.Series(data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6], dtype="float64")
93+
s2 = pd.Series(
94+
data=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6], dtype="float64" if IS64 else "float32"
95+
)
8996
pandasmeth = getattr(s2, pandasmethname)
9097
expected = pandasmeth(**kwargs)
9198
assert expected == result

pandas/tests/base/test_misc.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
import pytest
55

6-
from pandas.compat import PYPY
6+
from pandas.compat import IS64, PYPY
77

88
from pandas.core.dtypes.common import (
99
is_categorical_dtype,
@@ -128,7 +128,10 @@ def test_memory_usage(index_or_series_obj):
128128
)
129129

130130
if len(obj) == 0:
131-
expected = 0 if isinstance(obj, Index) else 80
131+
if isinstance(obj, Index):
132+
expected = 0
133+
else:
134+
expected = 80 if IS64 else 48
132135
assert res_deep == res == expected
133136
elif is_object or is_categorical:
134137
# only deep will pick them up

pandas/tests/groupby/test_groupby.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1268,8 +1268,8 @@ def test_groupby_nat_exclude():
12681268
assert grouped.ngroups == 2
12691269

12701270
expected = {
1271-
Timestamp("2013-01-01 00:00:00"): np.array([1, 7], dtype=np.int64),
1272-
Timestamp("2013-02-01 00:00:00"): np.array([3, 5], dtype=np.int64),
1271+
Timestamp("2013-01-01 00:00:00"): np.array([1, 7], dtype=np.intp),
1272+
Timestamp("2013-02-01 00:00:00"): np.array([3, 5], dtype=np.intp),
12731273
}
12741274

12751275
for k in grouped.indices:

pandas/tests/io/parser/test_c_parser_only.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import numpy as np
1414
import pytest
1515

16+
from pandas.compat import IS64
1617
from pandas.errors import ParserError
1718
import pandas.util._test_decorators as td
1819

@@ -717,7 +718,10 @@ def test_float_precision_options(c_parser_only):
717718

718719
df3 = parser.read_csv(StringIO(s), float_precision="legacy")
719720

720-
assert not df.iloc[0, 0] == df3.iloc[0, 0]
721+
if IS64:
722+
assert not df.iloc[0, 0] == df3.iloc[0, 0]
723+
else:
724+
assert df.iloc[0, 0] == df3.iloc[0, 0]
721725

722726
msg = "Unrecognized float_precision option: junk"
723727

0 commit comments

Comments
 (0)