Skip to content

Commit cc5f3f4

Browse files
Backport PR #31594: TST: troubleshoot npdev build (#31610)
* TST: troubleshoot npdev build (#31594) * fixup Co-authored-by: jbrockmendel <[email protected]>
1 parent f027c3c commit cc5f3f4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

pandas/core/series.py

-1
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,6 @@ def _set_value(self, label, value, takeable: bool = False):
11381138
else:
11391139
self.index._engine.set_value(self._values, label, value)
11401140
except (KeyError, TypeError):
1141-
11421141
# set using a non-recursive method
11431142
self.loc[label] = value
11441143

pandas/tests/dtypes/test_common.py

+2
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ def test__get_dtype(input_param, result):
675675
)
676676
def test__get_dtype_fails(input_param, expected_error_message):
677677
# python objects
678+
# 2020-02-02 npdev changed error message
679+
expected_error_message += f"|Cannot interpret '{input_param}' as a data type"
678680
with pytest.raises(TypeError, match=expected_error_message):
679681
com._get_dtype(input_param)
680682

pandas/tests/dtypes/test_dtypes.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ def test_equality_invalid(self):
4343
assert not is_dtype_equal(self.dtype, np.int64)
4444

4545
def test_numpy_informed(self):
46-
with pytest.raises(TypeError, match="data type not understood"):
46+
# npdev 2020-02-02 changed from "data type not understood" to
47+
# "Cannot interpret 'foo' as a data type"
48+
msg = "|".join(
49+
["data type not understood", "Cannot interpret '.*' as a data type"]
50+
)
51+
with pytest.raises(TypeError, match=msg):
4752
np.dtype(self.dtype)
4853

4954
assert not self.dtype == np.str_

0 commit comments

Comments
 (0)