diff --git a/docs/source/package_definition.rst b/docs/source/package_definition.rst index b4ad4ab3d..80e2cb8d1 100644 --- a/docs/source/package_definition.rst +++ b/docs/source/package_definition.rst @@ -854,13 +854,14 @@ the data type, and includes a code snippet. tests = { "unit": "python -m unittest discover -s {root}/python/tests", + "unit-as-list": ["python", "-m", "unittest", "discover", "-s", "{root}/python/tests"], "lint": { "command": "pylint mymodule", "requires": ["pylint"], "run_on": ["default", "pre_release"] }, "maya_CI": { - "command": "python {root}/ci_tests/maya.py", + "command": ["python", "{root}/ci_tests/maya.py"], "on_variants": { "type": "requires", "value": ["maya"] diff --git a/src/rez/package_test.py b/src/rez/package_test.py index 3c85882d1..f0ad9d133 100644 --- a/src/rez/package_test.py +++ b/src/rez/package_test.py @@ -394,7 +394,9 @@ def run_test(self, test_name, extra_test_args=None): if isinstance(command, str): command = variant.format(command) else: - command = map(variant.format, command) + # Note that we convert the iterator to a list to + # make sure that we can consume the variable more than once. + command = [x for x in map(variant.format, command)] if extra_test_args: if isinstance(command, str):