[Pkg-bitcoin-commits] [python-quamash] 135/269: Make tests finish earlier

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 0be200480bb0121132bc0fbbbf33ecc05f5e22da
Author: Arve Knudsen <arve.knudsen at gmail.com>
Date:   Sat Dec 6 20:23:20 2014 +0100

    Make tests finish earlier
---
 tests/test_qeventloop.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/test_qeventloop.py b/tests/test_qeventloop.py
index db66a27..6acb6bf 100644
--- a/tests/test_qeventloop.py
+++ b/tests/test_qeventloop.py
@@ -258,6 +258,7 @@ def test_can_add_reader(loop, sock_pair):
 		got_msg = data
 		# Indicate that we're done
 		fut.set_result(None)
+		srv_sock.close()
 
 	def write():
 		client_sock.send(ref_msg)
@@ -308,8 +309,9 @@ def test_can_add_writer(loop, sock_pair):
 	def can_write():
 		# Indicate that we're done
 		fut.set_result(None)
+		client_sock.close()
 
-	client_sock, srv_sock = sock_pair
+	client_sock, _ = sock_pair
 	fut = asyncio.Future()
 	loop.add_writer(client_sock.fileno(), can_write)
 	assert len(loop._write_notifiers) == 1, 'Notifier should be added'
@@ -318,10 +320,7 @@ def test_can_add_writer(loop, sock_pair):
 
 def test_can_remove_writer(loop, sock_pair):
 	"""Verify that we can remove a writer callback from an event loop."""
-	def can_write():
-		pass
-
-	client_sock, srv_sock = sock_pair
-	loop.add_writer(client_sock.fileno(), can_write)
+	client_sock, _ = sock_pair
+	loop.add_writer(client_sock.fileno(), lambda: None)
 	loop.remove_writer(client_sock.fileno())
 	assert not loop._write_notifiers, 'Notifier should be removed'

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