Browse Source

Add returncode support to helper.make

master
Thom Wiggers 5 years ago
parent
commit
dc1f7e204a
No known key found for this signature in database GPG Key ID: 1BB0A7CE26E363
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      test/helpers.py

+ 4
- 2
test/helpers.py View File

@@ -26,11 +26,12 @@ def run_subprocess(command, working_dir='.', env=None, expected_returncode=0):
env=env,
)
print(result.stdout.decode('utf-8'))
assert(result.returncode == expected_returncode)
assert result.returncode == expected_returncode, \
"Got unexpected return code {}".format(result.returncode)
return result.stdout.decode('utf-8')


def make(*args, working_dir='.', env=None, **kwargs):
def make(*args, working_dir='.', env=None, expected_returncode=0, **kwargs):
"""
Runs a make target in the specified working directory

@@ -54,6 +55,7 @@ def make(*args, working_dir='.', env=None, **kwargs):
],
working_dir=working_dir,
env=env,
expected_returncode=expected_returncode,
)




Loading…
Cancel
Save