[Pkg-bitcoin-commits] [python-quamash] 90/269: Test all executors

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:19 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 f3e14236942038837dbcb7f2e8e8f899baa5ebc2
Author: Mark Harviston <mark.harviston at gmail.com>
Date:   Wed Jul 16 23:24:02 2014 -0700

    Test all executors
    
    The default executor, the QThreadExecutor and the 2 builtin executors (ThreadPool and ProcessPool)
---
 tests/test_qeventloop.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/tests/test_qeventloop.py b/tests/test_qeventloop.py
index 3d8cd32..61b1edf 100644
--- a/tests/test_qeventloop.py
+++ b/tests/test_qeventloop.py
@@ -3,6 +3,8 @@ import os.path
 import logging
 import sys
 import locale
+from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
+
 try:
 	from PyQt5.QtWidgets import QApplication
 except ImportError:
@@ -52,7 +54,20 @@ def loop(request, application):
 	return lp
 
 
-def test_can_run_tasks_in_default_executor(loop):
+ at pytest.fixture(
+	params=[None, quamash.QThreadExecutor, ThreadPoolExecutor, ProcessPoolExecutor],
+)
+def executor(request):
+	exc_cls = request.param
+	if exc_cls is None:
+		return None
+
+	exc = exc_cls(5)  # FIXME? fixed number of workers
+	request.addfinalizer(exc.shutdown)
+	return exc
+
+
+def test_can_run_tasks_in_executor(loop, executor):
 	"""Verify that tasks can be run in default (threaded) executor."""
 	def blocking_func():
 		nonlocal was_invoked

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