Skip to content

Commit a29b374

Browse files
[Backport maintenance/3.3.x] Partial backport of (pylint-dev#2765)
* Remove nose test dependency * Filter warnings for the test for old namespace package based on pkg_resource Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
1 parent fbea510 commit a29b374

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

requirements_full.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# Packages used to run additional tests
55
attrs
6-
nose
76
numpy>=1.17.0,<2; python_version<"3.12"
87
python-dateutil
98
PyQt6

tests/test_manager.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,15 @@ def test_ast_from_namespace_pkg_resources(self) -> None:
120120
def test_identify_old_namespace_package_protocol(self) -> None:
121121
# Like the above cases, this package follows the old namespace package protocol
122122
# astroid currently assumes such packages are in sys.modules, so import it
123-
# pylint: disable-next=import-outside-toplevel
124-
import tests.testdata.python3.data.path_pkg_resources_1.package.foo as _ # noqa
123+
with warnings.catch_warnings():
124+
warnings.filterwarnings(
125+
"ignore",
126+
category=UserWarning,
127+
message=".*pkg_resources is deprecated.*",
128+
)
129+
130+
# pylint: disable-next=import-outside-toplevel
131+
import tests.testdata.python3.data.path_pkg_resources_1.package.foo as _ # noqa
125132

126133
self.assertTrue(
127134
util.is_namespace("tests.testdata.python3.data.path_pkg_resources_1")

0 commit comments

Comments
 (0)