Skip to content

Commit

Permalink
Fix test commands defined as list that result in an empty command whe…
Browse files Browse the repository at this point in the history
…n verbosity is enabled (#1850)

Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso authored Oct 14, 2024
1 parent 102c8e7 commit 84c827d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/source/package_definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 3 additions & 1 deletion src/rez/package_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 84c827d

Please sign in to comment.