[Pkg-bitcoin-commits] [python-quamash] 138/269: Fix tests

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:24 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 2b717d294ba7cd0d0307b83eb7ac64307a7ca542
Author: Arve Knudsen <arve.knudsen at gmail.com>
Date:   Wed Nov 26 13:16:08 2014 +0100

    Fix tests
---
 tests/test_qeventloop.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/test_qeventloop.py b/tests/test_qeventloop.py
index 6acb6bf..39e659f 100644
--- a/tests/test_qeventloop.py
+++ b/tests/test_qeventloop.py
@@ -250,6 +250,9 @@ def sock_pair(request):
 def test_can_add_reader(loop, sock_pair):
 	"""Verify that we can add a reader callback to an event loop."""
 	def can_read():
+		if fut.done():
+			return
+
 		data = srv_sock.recv(1)
 		if len(data) != 1:
 			return
@@ -307,8 +310,9 @@ def test_can_remove_reader(loop, sock_pair):
 def test_can_add_writer(loop, sock_pair):
 	"""Verify that we can add a writer callback to an event loop."""
 	def can_write():
-		# Indicate that we're done
-		fut.set_result(None)
+		if not fut.done():
+			# Indicate that we're done
+			fut.set_result(None)
 		client_sock.close()
 
 	client_sock, _ = sock_pair

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