Skip to content

Commit 3c53965

Browse files
jbrockmendeljorisvandenbossche
authored andcommitted
TST: troubleshoot npdev build (pandas-dev#31594)
1 parent 78e6ec0 commit 3c53965

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

pandas/core/series.py

Lines changed: 0 additions & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@ def test_equality_invalid(self):
4242
assert not self.dtype == "foo"
4343
assert not is_dtype_equal(self.dtype, np.int64)
4444

45-
def test_numpy_informed(self):
46-
with pytest.raises(TypeError, match="data type not understood"):
47-
np.dtype(self.dtype)
45+
def test_numpy_informed(self, dtype):
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):
52+
np.dtype(dtype)
4853

4954
assert not self.dtype == np.str_
5055
assert not np.str_ == self.dtype

0 commit comments

Comments
 (0)