File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,15 @@ def test_ast_from_namespace_pkg_resources(self) -> None:
120
120
def test_identify_old_namespace_package_protocol (self ) -> None :
121
121
# Like the above cases, this package follows the old namespace package protocol
122
122
# 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
125
132
126
133
self .assertTrue (
127
134
util .is_namespace ("tests.testdata.python3.data.path_pkg_resources_1" )
You can’t perform that action at this time.
0 commit comments