]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Cleanly shut down the ThreadPoolExecutor in Resolver tests.
authorBen Darnell <ben@bendarnell.com>
Sun, 30 Sep 2012 00:46:50 +0000 (17:46 -0700)
committerBen Darnell <ben@bendarnell.com>
Sun, 30 Sep 2012 00:46:50 +0000 (17:46 -0700)
This was somehow causing a problem on Ubuntu 10.04.

tornado/test/netutil_test.py

index 69c0ae33f5a68315728f0821e04253971d959bfa..a2966b2be1ba4c92b315a711847647922686fc45 100644 (file)
@@ -32,6 +32,11 @@ class ThreadedResolverTest(AsyncTestCase, _ResolverTestMixin):
     def setUp(self):
         super(ThreadedResolverTest, self).setUp()
         from concurrent.futures import ThreadPoolExecutor
-        self.resolver = Resolver(self.io_loop, ThreadPoolExecutor(2))
+        self.executor = ThreadPoolExecutor(2)
+        self.resolver = Resolver(self.io_loop, self.executor)
+
+    def tearDown(self):
+        self.executor.shutdown()
+        super(ThreadedResolverTest, self).tearDown()
 ThreadedResolverTest = unittest.skipIf(
     futures is None, "futures module not present")(ThreadedResolverTest)