Skip to content

Commit 91100f7

Browse files
committed
modify tests to expect intended error
1 parent 001c3a0 commit 91100f7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pandas/tests/frame/test_replace.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,9 @@ def test_replace_with_empty_list(self):
614614
result = df.replace([], np.nan)
615615
assert_frame_equal(result, expected)
616616
# GH 19266
617-
with tm.assert_raises_regex(NotImplementedError, 'Replace with array'):
617+
with tm.assert_raises_regex(Exception, "cannot assign mismatch"):
618618
df.replace({np.nan: []})
619-
with tm.assert_raises_regex(NotImplementedError, 'Replace with array'):
619+
with tm.assert_raises_regex(Exception, "cannot assign mismatch"):
620620
df.replace({np.nan: ['dummy', 'alt']})
621621

622622
def test_replace_series_dict(self):

pandas/tests/series/indexing/test_boolean.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ def test_where_unsafe():
213213
def f():
214214
s[mask] = [5, 4, 3, 2, 1]
215215

216-
pytest.raises(ValueError, f)
216+
pytest.raises(Exception, f)
217217

218218
def f():
219219
s[mask] = [0] * 5
220220

221-
pytest.raises(ValueError, f)
221+
pytest.raises(Exception, f)
222222

223223
# dtype changes
224224
s = Series([1, 2, 3, 4])

pandas/tests/series/test_replace.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ def test_replace_with_empty_list(self):
138138
tm.assert_series_equal(result, expected)
139139

140140
# GH 19266
141-
with tm.assert_raises_regex(NotImplementedError, 'Replace with array'):
141+
with tm.assert_raises_regex(Exception, "cannot assign mismatch"):
142142
s.replace({np.nan: []})
143-
with tm.assert_raises_regex(NotImplementedError, 'Replace with array'):
143+
with tm.assert_raises_regex(Exception, "cannot assign mismatch"):
144144
s.replace({np.nan: ['dummy', 'alt']})
145145

146146
def test_replace_mixed_types(self):

0 commit comments

Comments
 (0)