Skip to content

Commit a7cee8a

Browse files
update expected message
1 parent 2495ad2 commit a7cee8a

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

pandas/tests/arrays/string_/test_string_arrow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def test_from_sequence_wrong_dtype_raises(using_infer_string):
178178

179179
@td.skip_if_installed("pyarrow")
180180
def test_pyarrow_not_installed_raises():
181-
msg = re.escape("pyarrow>=10.0.1 is required for PyArrow backed")
181+
msg = re.escape("pyarrow>=12.0.1 is required for PyArrow backed")
182182

183183
with pytest.raises(ImportError, match=msg):
184184
StringDtype(storage="pyarrow")

pandas/tests/base/test_misc.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
import numpy as np
44
import pytest
55

6-
from pandas._config import using_string_dtype
7-
8-
from pandas.compat import PYPY
9-
106
from pandas.core.dtypes.common import (
117
is_dtype_equal,
128
is_object_dtype,
@@ -81,10 +77,10 @@ def test_ndarray_compat_properties(index_or_series_obj):
8177
assert Series([1]).item() == 1
8278

8379

84-
@pytest.mark.skipif(
85-
PYPY or using_string_dtype(),
86-
reason="not relevant for PyPy doesn't work properly for arrow strings",
87-
)
80+
# @pytest.mark.skipif(
81+
# PYPY or using_string_dtype(),
82+
# reason="not relevant for PyPy doesn't work properly for arrow strings",
83+
# )
8884
def test_memory_usage(index_or_series_memory_obj):
8985
obj = index_or_series_memory_obj
9086
# Clear index caches so that len(obj) == 0 report 0 memory usage
@@ -98,7 +94,12 @@ def test_memory_usage(index_or_series_memory_obj):
9894
res = obj.memory_usage()
9995
res_deep = obj.memory_usage(deep=True)
10096

101-
is_object = is_object_dtype(obj) or (is_ser and is_object_dtype(obj.index))
97+
def _is_object_dtype(obj):
98+
if isinstance(obj, pd.MultiIndex):
99+
return any(is_object_dtype(level) for level in obj.levels)
100+
return is_object_dtype(obj)
101+
102+
is_object = _is_object_dtype(obj) or (is_ser and _is_object_dtype(obj.index))
102103
is_categorical = isinstance(obj.dtype, pd.CategoricalDtype) or (
103104
is_ser and isinstance(obj.index.dtype, pd.CategoricalDtype)
104105
)
@@ -111,7 +112,7 @@ def test_memory_usage(index_or_series_memory_obj):
111112
assert res_deep == res == expected
112113
elif is_object or is_categorical or is_object_string:
113114
# only deep will pick them up
114-
assert res_deep > res
115+
assert res_deep > res, (res_deep, res)
115116
else:
116117
assert res == res_deep
117118

0 commit comments

Comments
 (0)