Skip to content

Commit f63f68f

Browse files
committed
Fix test_cmdline_python_namespace_package
pgk_resources.declare_namespace has been deprecated, so added an ignore warnings option to the test.
1 parent 88c9e92 commit f63f68f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

testing/acceptance_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,14 @@ def test_cmdline_python_namespace_package(
693693

694694
# mixed module and filenames:
695695
monkeypatch.chdir("world")
696-
result = pytester.runpytest("--pyargs", "-v", "ns_pkg.hello", "ns_pkg/world")
696+
697+
# pgk_resources.declare_namespace has been deprecated in favor of implicit namespace packages.
698+
# While we could change the test to use implicit namespace packages, seems better
699+
# to still ensure the old declaration via declare_namespace still works.
700+
ignore_w = r"-Wignore:Deprecated call to `pkg_resources.declare_namespace"
701+
result = pytester.runpytest(
702+
"--pyargs", "-v", "ns_pkg.hello", "ns_pkg/world", ignore_w
703+
)
697704
assert result.ret == 0
698705
result.stdout.fnmatch_lines(
699706
[

0 commit comments

Comments
 (0)