From 3828e51cd7e14c6b4678094465b09f1b28b8de46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com> Date: Mon, 27 Mar 2023 11:33:20 +0200 Subject: [PATCH] DEBUG: --- unittests/test_crawler.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unittests/test_crawler.py b/unittests/test_crawler.py index b603c62a..f3ad73c5 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) -- GitLab