Skip to content
Snippets Groups Projects
Commit 71c1a05d authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests/run-tests: Close device under test using "finally".

We want to close communication object even if there were exceptions
somewhere in the code. This is important for --device exec:/execpty:
which may otherwise leave processing running in the background.
parent 58ea2395
No related branches found
No related tags found
No related merge requests found
......@@ -492,9 +492,12 @@ def main():
# we need to access feature_check's from the same directory as the
# run-tests script itself.
base_path = os.path.dirname(sys.argv[0]) or "."
res = run_tests(pyb, tests, args, base_path)
if pyb:
pyb.close()
try:
res = run_tests(pyb, tests, args, base_path)
finally:
if pyb:
pyb.close()
if not res:
sys.exit(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment