From fdb0bd50e00ef542d5e591847e4085dbc79e4913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Sat, 13 Jun 2015 00:46:10 +0300 Subject: [PATCH] Added pypy to tox environments and fixed tests on pypy --- test_futures.py | 15 +++++++++------ tox.ini | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/test_futures.py b/test_futures.py index ace340c..301cd0a 100644 --- a/test_futures.py +++ b/test_futures.py @@ -7,6 +7,7 @@ import contextlib import logging import re import time +import gc from StringIO import StringIO from test import test_support @@ -222,6 +223,7 @@ class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest): executor.map(abs, range(-5, 5)) threads = executor._threads del executor + gc.collect() for t in threads: t.join() @@ -257,6 +259,7 @@ class ProcessPoolShutdownTest(ProcessPoolMixin, ExecutorShutdownTest): queue_management_thread = executor._queue_management_thread processes = executor._processes del executor + gc.collect() queue_management_thread.join() for p in processes: @@ -575,19 +578,19 @@ class FutureTests(unittest.TestCase): def test_repr(self): self.assertRegexpMatches(repr(PENDING_FUTURE), - '') + '') self.assertRegexpMatches(repr(RUNNING_FUTURE), - '') + '') self.assertRegexpMatches(repr(CANCELLED_FUTURE), - '') + '') self.assertRegexpMatches(repr(CANCELLED_AND_NOTIFIED_FUTURE), - '') + '') self.assertRegexpMatches( repr(EXCEPTION_FUTURE), - '') + '') self.assertRegexpMatches( repr(SUCCESSFUL_FUTURE), - '') + '') def test_cancel(self): f1 = create_future(state=PENDING) diff --git a/tox.ini b/tox.ini index 4948bd1..2b35e7d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27 +envlist = py26,py27,pypy,jython [testenv] commands={envpython} test_futures.py []