[Pkg-bitcoin-commits] [python-quamash] 237/269: test for #34 reproduced

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:37 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 dbb189dd7d62a3a91bde7c5fb74851666fe90447
Author: Mark Harviston <Mark.T.Harviston.-ND at disney.com>
Date:   Tue Jun 30 13:22:31 2015 -0700

    test for #34 reproduced
---
 tests/test_qeventloop.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/test_qeventloop.py b/tests/test_qeventloop.py
index fa5b512..67b8532 100644
--- a/tests/test_qeventloop.py
+++ b/tests/test_qeventloop.py
@@ -688,3 +688,29 @@ def test_scheduling(loop, sock_pair):
 	fut.add_done_callback(fut_cb)
 	loop.add_writer(fd, writer_cb, fut)
 	loop.run_until_complete(cb_called)
+
+
+def test_exception_handler(application):
+	handler_called = False
+	coro_run = False
+	loop = quamash.QEventLoop(application)
+	asyncio.set_event_loop(loop)
+
+	@asyncio.coroutine
+	def future_except():
+		nonlocal coro_run
+		coro_run = True
+		raise ExceptionTester()
+
+	def exct_handler(loop, data):
+		nonlocal handler_called
+		handler_called = True
+
+	try:
+		loop.set_exception_handler(exct_handler)
+		asyncio.async(future_except())
+		loop.run_until_complete(asyncio.sleep(.1))
+	finally:
+		asyncio.set_event_loop(None)
+	assert coro_run
+	assert handler_called

-- 
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