diff --git a/unittests/test_tool.py b/unittests/test_tool.py
index afb12a6bce3a8df19667b92850bed59c62f0d76a..e8bf23cf436436d29e00f09a53768b762bc538bd 100755
--- a/unittests/test_tool.py
+++ b/unittests/test_tool.py
@@ -989,7 +989,9 @@ def test_wrong_remove_prefix_option():
     with a bad value raises the correct error.
     """
 
-    with raises(RuntimeError) as ve:
+    with raises(RuntimeError) as re:
         crawler_main(rfp("test_directories", "examples_article"),
                      rfp("scifolder_extended.yml"),
                      remove_prefix="to/be/removed")
+
+    assert "path does not start with the prefix" in str(re.value)