Skip to content

Commit fa30b34

Browse files
author
MarcoFalke
committed
test: Do not pass tests on unhandled exceptions
This adds a missing catch for BaseException (e.g. SystemExit), which would otherwise be silently ignored. Also, remove the redundant other catches, which are just calling log.exception with a redundant log message.
1 parent 9f713b8 commit fa30b34

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,27 +194,18 @@ def main(self):
194194
else:
195195
self.run_test()
196196

197-
except JSONRPCException:
198-
self.log.exception("JSONRPC error")
199-
self.success = TestStatus.FAILED
200197
except SkipTest as e:
201198
self.log.warning("Test Skipped: %s" % e.message)
202199
self.success = TestStatus.SKIPPED
203-
except AssertionError:
204-
self.log.exception("Assertion failed")
205-
self.success = TestStatus.FAILED
206-
except KeyError:
207-
self.log.exception("Key error")
208-
self.success = TestStatus.FAILED
209200
except subprocess.CalledProcessError as e:
210201
self.log.exception("Called Process failed with '{}'".format(e.output))
211202
self.success = TestStatus.FAILED
212-
except Exception:
213-
self.log.exception("Unexpected exception caught during testing")
214-
self.success = TestStatus.FAILED
215203
except KeyboardInterrupt:
216204
self.log.warning("Exiting after keyboard interrupt")
217205
self.success = TestStatus.FAILED
206+
except BaseException:
207+
self.log.exception("Unexpected exception")
208+
self.success = TestStatus.FAILED
218209
finally:
219210
exit_code = self.shutdown()
220211
sys.exit(exit_code)

0 commit comments

Comments
 (0)