Skip to content

Filter warnings for the test for old namespace package based on pkg_resource #2773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: maintenance/3.3.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading