Skip to content

Commit f72c4cf

Browse files
[7.3.x] Filter new pkg_resources deprecations (#10944)
Co-authored-by: Miro Hrončok <[email protected]>
1 parent 6193bf7 commit f72c4cf

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

testing/acceptance_test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,15 @@ def test_cmdline_python_namespace_package(
695695
monkeypatch.chdir("world")
696696

697697
# pgk_resources.declare_namespace has been deprecated in favor of implicit namespace packages.
698+
# pgk_resources has been deprecated entirely.
698699
# While we could change the test to use implicit namespace packages, seems better
699700
# to still ensure the old declaration via declare_namespace still works.
700-
ignore_w = r"-Wignore:Deprecated call to `pkg_resources.declare_namespace"
701+
ignore_w = (
702+
r"-Wignore:Deprecated call to `pkg_resources.declare_namespace",
703+
r"-Wignore:pkg_resources is deprecated",
704+
)
701705
result = pytester.runpytest(
702-
"--pyargs", "-v", "ns_pkg.hello", "ns_pkg/world", ignore_w
706+
"--pyargs", "-v", "ns_pkg.hello", "ns_pkg/world", *ignore_w
703707
)
704708
assert result.ret == 0
705709
result.stdout.fnmatch_lines(

testing/test_monkeypatch.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,7 @@ class A:
425425
assert A.x == 1
426426

427427

428-
@pytest.mark.filterwarnings(
429-
"ignore:Deprecated call to `pkg_resources.declare_namespace"
430-
)
428+
@pytest.mark.filterwarnings(r"ignore:.*\bpkg_resources\b:DeprecationWarning")
431429
def test_syspath_prepend_with_namespace_packages(
432430
pytester: Pytester, monkeypatch: MonkeyPatch
433431
) -> None:

0 commit comments

Comments
 (0)