Browse Source

[test] calculator plugin: report the DeprecationWarning once (#5070)

Reporting the DeprecationWarning once should be sufficient when running tests.
Markus Heiser 2 days ago
parent
commit
6b9e12e4c1
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tests/unit/test_plugin_calculator.py

+ 6 - 0
tests/unit/test_plugin_calculator.py

@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: AGPL-3.0-or-later
 # SPDX-License-Identifier: AGPL-3.0-or-later
 # pylint: disable=missing-module-docstring,disable=missing-class-docstring,invalid-name
 # pylint: disable=missing-module-docstring,disable=missing-class-docstring,invalid-name
 
 
+import warnings
+
 from parameterized.parameterized import parameterized
 from parameterized.parameterized import parameterized
 
 
 import searx.plugins
 import searx.plugins
@@ -14,6 +16,10 @@ from .test_utils import random_string
 from .test_plugins import do_post_search
 from .test_plugins import do_post_search
 
 
 
 
+# Reporting the DeprecationWarning once should be sufficient when running tests
+warnings.filterwarnings("once", category=DeprecationWarning)
+
+
 class PluginCalculator(SearxTestCase):
 class PluginCalculator(SearxTestCase):
 
 
     def setUp(self):
     def setUp(self):