diff --git a/src/rez/tests/test_suites.py b/src/rez/tests/test_suites.py index 8b4b20351b..fcd343453f 100644 --- a/src/rez/tests/test_suites.py +++ b/src/rez/tests/test_suites.py @@ -9,6 +9,7 @@ per_available_shell, install_dependent from rez.resolved_context import ResolvedContext from rez.suite import Suite +from rez.wrapper import Wrapper from rez.config import config from rez.system import system import subprocess @@ -141,6 +142,18 @@ def test_3(self) -> None: self._test_serialization(s) + def test_print_package_versions(self) -> None: + """Test that a wrapper can print the versions of its package.""" + c_foo = ResolvedContext(["foo"]) + s = Suite() + s.add_context("foo", c_foo) + + suite_path = os.path.join(self.root, uuid.uuid4().hex) + s.save(suite_path) + + w = Wrapper(os.path.join(suite_path, "bin", "fooer")) + self.assertEqual(w.print_package_versions(), 0) + @per_available_shell() @install_dependent() def test_executable(self, shell) -> None: diff --git a/src/rez/wrapper.py b/src/rez/wrapper.py index 75e401e636..a48cd4817a 100644 --- a/src/rez/wrapper.py +++ b/src/rez/wrapper.py @@ -248,7 +248,7 @@ def print_package_versions(self) -> int: col = local if pkg.is_local else None label = "(local)" if pkg.is_local else "" - rows.append((name, pkg.path, label)) + rows.append((name, pkg.uri, label)) colors.append(col) _pr = Printer()