diff --git a/unittests/test_crawler.py b/unittests/test_crawler.py index b603c62aec78cccd0d1782c33aacc2230dc8a7fd..f3ad73c5d75acea5fd3e92954e3899983ea73a2a 100644 --- a/unittests/test_crawler.py +++ b/unittests/test_crawler.py @@ -42,7 +42,8 @@ import pytest def test_constructor(): with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. - warnings.simplefilter("always") + warnings.filterwarnings("ignore") + warnings.filterwarnings("always", category=DeprecationWarning) Crawler(debug=True) assert issubclass(w[-1].category, DeprecationWarning) @@ -57,9 +58,12 @@ def test_constructor(): def test_deprecated_functions(): with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. - warnings.simplefilter("always") + warnings.filterwarnings("ignore") + warnings.filterwarnings("always", category=DeprecationWarning) cr = Crawler() cr.crawl_directory(".", rfp("scifolder_cfood.yml")) + print(w) + print(w[0].message) assert issubclass(w[-1].category, DeprecationWarning) assert "The function crawl_directory in the crawl" in str(w[-1].message)