Skip to content

Commit 05a5fb8

Browse files
committed
TST: Use pytest.raises match parameter in test_missing_required_dependency
1 parent 5f5ab6a commit 05a5fb8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/tests/test_downstream.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,9 @@ def mock_import(name, *args, **kwargs):
200200

201201
monkeypatch.setattr("builtins.__import__", mock_import)
202202

203-
with pytest.raises(ImportError) as excinfo:
203+
with pytest.raises(ImportError, match=dependency):
204204
importlib.reload(importlib.import_module("pandas"))
205205

206-
assert dependency in str(excinfo.value)
207-
208206

209207
def test_frame_setitem_dask_array_into_new_col(request):
210208
# GH#47128

0 commit comments

Comments
 (0)