diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py index 8929161046504cdbaee14d548ba51e6fe3474a1b..9f9f87238766d19ccdad5663e63d8b3c2e8a73ce 100644 --- a/src/caoscrawler/crawl.py +++ b/src/caoscrawler/crawl.py @@ -1283,8 +1283,8 @@ def crawler_main(crawled_directory_path: str, crawler.identifiableAdapter = ident if prefix != "": - warnings.warn(DeprecationWarning("The prefix argument is derpicated. Please use " - "remove_prefix.")) + warnings.warn(DeprecationWarning("The prefix argument is deprecated and will be removed " + "in the future. Please use `remove_prefix` instead.")) if remove_prefix is not None: raise ValueError("Please do not supply prefix argument. Only remove_prefix") remove_prefix = prefix diff --git a/unittests/test_tool.py b/unittests/test_tool.py index 0cbfbdc5071ff9881c52916136839668e4032210..eb4350bd1b5adc29941b12e9d0de99991e143321 100755 --- a/unittests/test_tool.py +++ b/unittests/test_tool.py @@ -966,3 +966,13 @@ def test_split_restricted_path(): assert ["el"] == split_restricted_path("/el") assert ["el"] == split_restricted_path("/el/") assert ["el", "el"] == split_restricted_path("/el/el") + + +def test_deprecated_prefix_option(): + """Test that calling the crawler's main function with the deprecated + `prefix` option correctly raises a Deprecation warning. + + """ + + with pytest.deprecated_call(): + crawler_main("./", rfp("scifolder_cfood.yml"), prefix="to/be/removed")