From ef0a9c00af10f0cbdd7f8fb91def359145b65428 Mon Sep 17 00:00:00 2001 From: Daniel Valenzuela Date: Wed, 25 Oct 2023 19:59:59 -0300 Subject: [PATCH] chore: ignore import ABCs from 'collections' warning related issue: https://github.com/openedx/edx-platform/issues/33584 note: this warning is from a third party library (libsass) --- cms/pytest.ini | 3 ++- common/test/pytest.ini | 4 ++-- openedx/core/lib/logsettings.py | 6 ++++++ setup.cfg | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cms/pytest.ini b/cms/pytest.ini index 1bfc59dbbeae..2c7bc22f3a14 100644 --- a/cms/pytest.ini +++ b/cms/pytest.ini @@ -14,7 +14,8 @@ filterwarnings = ignore::xblock.exceptions.FieldDataDeprecationWarning # Remove default_app_config warning after updating Django to 4.2 ignore:.*You can remove default_app_config.*:PendingDeprecationWarning - ignore:Instead access HTTPResponse.headers directly.*:DeprecationWarning:elasticsearch + # ABC deprecation Warning comes from libsass + ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated.*:DeprecationWarning:sass norecursedirs = envs python_classes = diff --git a/common/test/pytest.ini b/common/test/pytest.ini index 1fc58225057a..a4fcf2042369 100644 --- a/common/test/pytest.ini +++ b/common/test/pytest.ini @@ -13,6 +13,6 @@ filterwarnings = ignore::xblock.exceptions.FieldDataDeprecationWarning # Remove default_app_config warning after updating Django to 4.2 ignore:.*You can remove default_app_config.*:PendingDeprecationWarning - ignore:Instead access HTTPResponse.headers directly.*:DeprecationWarning:elasticsearch - + # ABC deprecation Warning comes from libsass + ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated.*:DeprecationWarning:sass norecursedirs = .cache diff --git a/openedx/core/lib/logsettings.py b/openedx/core/lib/logsettings.py index 67bfd9c87172..0ea195f1f271 100644 --- a/openedx/core/lib/logsettings.py +++ b/openedx/core/lib/logsettings.py @@ -138,6 +138,12 @@ def log_python_warnings(): category=DeprecationWarning, module='elasticsearch' ) + warnings.filterwarnings( + 'ignore', + 'Using or importing the ABCs from \'collections\' instead of from \'collections.abc\' is deprecated.*', + category=DeprecationWarning, + module="sass", + ) # try: # # There are far too many of these deprecation warnings in startup to output for every management command; # # suppress them until we've fixed at least the most common ones as reported by the test suite diff --git a/setup.cfg b/setup.cfg index 6e9a4b44e2cb..cc48260efc7a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,6 +15,8 @@ filterwarnings = # Remove default_app_config warning after updating Django to 4.2 ignore:.*You can remove default_app_config.*:PendingDeprecationWarning ignore:Instead access HTTPResponse.headers directly.*:DeprecationWarning:elasticsearch + # ABC deprecation Warning comes from libsass + ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated.*:DeprecationWarning:sass junit_family = xunit2 norecursedirs = .* *.egg build conf dist node_modules test_root cms/envs lms/envs