From a29b3746da1117c5f81df791ffc957f637abd86d Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Thu, 4 Sep 2025 11:12:21 +0200 Subject: [PATCH] [Backport maintenance/3.3.x] Partial backport of (#2765) * Remove nose test dependency * Filter warnings for the test for old namespace package based on pkg_resource Co-authored-by: Pierre Sassoulas --- requirements_full.txt | 1 - tests/test_manager.py | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/requirements_full.txt b/requirements_full.txt index 99cd84a6ee..c2d4935b79 100644 --- a/requirements_full.txt +++ b/requirements_full.txt @@ -3,7 +3,6 @@ # Packages used to run additional tests attrs -nose numpy>=1.17.0,<2; python_version<"3.12" python-dateutil PyQt6 diff --git a/tests/test_manager.py b/tests/test_manager.py index 9a7bbdb7ef..6a0f791686 100644 --- a/tests/test_manager.py +++ b/tests/test_manager.py @@ -120,8 +120,15 @@ def test_ast_from_namespace_pkg_resources(self) -> None: def test_identify_old_namespace_package_protocol(self) -> None: # Like the above cases, this package follows the old namespace package protocol # astroid currently assumes such packages are in sys.modules, so import it - # pylint: disable-next=import-outside-toplevel - import tests.testdata.python3.data.path_pkg_resources_1.package.foo as _ # noqa + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + category=UserWarning, + message=".*pkg_resources is deprecated.*", + ) + + # pylint: disable-next=import-outside-toplevel + import tests.testdata.python3.data.path_pkg_resources_1.package.foo as _ # noqa self.assertTrue( util.is_namespace("tests.testdata.python3.data.path_pkg_resources_1")