[Pkg-bitcoin-commits] [python-quamash] 144/269: During tests, stop event loop in case of uncaught exception

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository python-quamash.

commit 23eecab7dc14edb8c2b25bb076e39f055b0b51c1
Author: Arve Knudsen <arve.knudsen at gmail.com>
Date:   Sat Dec 6 22:21:53 2014 +0100

    During tests, stop event loop in case of uncaught exception
---
 tests/test_qeventloop.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/test_qeventloop.py b/tests/test_qeventloop.py
index 2d712e8..db97a91 100644
--- a/tests/test_qeventloop.py
+++ b/tests/test_qeventloop.py
@@ -40,11 +40,20 @@ def loop(request, application):
 	asyncio.set_event_loop(lp)
 
 	def fin():
+		sys.excepthook = orig_excepthook
+
 		try:
 			lp.close()
 		finally:
 			asyncio.set_event_loop(None)
 
+	def excepthook(type, *args):
+		lp.stop()
+		orig_excepthook(type, *args)
+
+	orig_excepthook = sys.excepthook
+	sys.excepthook = excepthook
+
 	request.addfinalizer(fin)
 	return lp
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/python-quamash.git



More information about the Pkg-bitcoin-commits mailing list