Skip to content

Commit db3496d

Browse files
committed
python test driver: use a finally clause to simplify code
1 parent 64eefe6 commit db3496d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

testsuite/drivers/lsp_python_driver.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,12 @@ def run_simple_test(test_function, working_dir) -> list[str]:
295295
lsp.send(initialized())
296296
lsp.send(didChangeConfiguration())
297297
test_function(lsp, working_dir)
298-
lsp.shutdown()
299-
return lsp.errors
300298
except Exception as e:
301299
lsp.errors += [str(e)]
302300
# If the exception is an AssertionError, no need for the traceback
303301
if not isinstance(e, ResponseAssertionError):
304302
lsp.errors.append(traceback.format_exc())
303+
finally:
305304
lsp.shutdown()
306305
return lsp.errors
307306

0 commit comments

Comments
 (0)