Skip to content

Commit 84c827d

Browse files
Fix test commands defined as list that result in an empty command when verbosity is enabled (#1850)
Signed-off-by: Jean-Christophe Morin <[email protected]>
1 parent 102c8e7 commit 84c827d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/source/package_definition.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,13 +854,14 @@ the data type, and includes a code snippet.
854854
855855
tests = {
856856
"unit": "python -m unittest discover -s {root}/python/tests",
857+
"unit-as-list": ["python", "-m", "unittest", "discover", "-s", "{root}/python/tests"],
857858
"lint": {
858859
"command": "pylint mymodule",
859860
"requires": ["pylint"],
860861
"run_on": ["default", "pre_release"]
861862
},
862863
"maya_CI": {
863-
"command": "python {root}/ci_tests/maya.py",
864+
"command": ["python", "{root}/ci_tests/maya.py"],
864865
"on_variants": {
865866
"type": "requires",
866867
"value": ["maya"]

src/rez/package_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ def run_test(self, test_name, extra_test_args=None):
394394
if isinstance(command, str):
395395
command = variant.format(command)
396396
else:
397-
command = map(variant.format, command)
397+
# Note that we convert the iterator to a list to
398+
# make sure that we can consume the variable more than once.
399+
command = [x for x in map(variant.format, command)]
398400

399401
if extra_test_args:
400402
if isinstance(command, str):

0 commit comments

Comments
 (0)