summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_smtplib.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-08-27 23:24:22 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-08-27 23:24:22 (GMT)
commit76f570a9c63eca7dda7d88c0827d34ee1ea53270 (patch)
tree6877fb395c87901989611dc4238383d76fb2e641 /Lib/test/test_smtplib.py
parenta5dba1abea05cf3b456b9cf2d1f95517adf8e10b (diff)
parentd54fa555cba8bb6d26469a5cc283c468a03f0db8 (diff)
downloadcpython-76f570a9c63eca7dda7d88c0827d34ee1ea53270.zip
cpython-76f570a9c63eca7dda7d88c0827d34ee1ea53270.tar.gz
cpython-76f570a9c63eca7dda7d88c0827d34ee1ea53270.tar.bz2
Make tests faster by reaping threads only at the end
Diffstat (limited to 'Lib/test/test_smtplib.py')
-rw-r--r--Lib/test/test_smtplib.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index 969ff15..05d97ef 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -177,7 +177,6 @@ class DebuggingServerTests(unittest.TestCase):
self.output = io.StringIO()
sys.stdout = self.output
- self._threads = support.threading_setup()
self.serv_evt = threading.Event()
self.client_evt = threading.Event()
# Capture SMTPChannel debug output
@@ -202,7 +201,6 @@ class DebuggingServerTests(unittest.TestCase):
# wait for the server thread to terminate
self.serv_evt.wait()
self.thread.join()
- support.threading_cleanup(*self._threads)
# restore sys.stdout
sys.stdout = self.old_stdout
# restore DEBUGSTREAM
@@ -681,7 +679,6 @@ class SMTPSimTests(unittest.TestCase):
def setUp(self):
self.real_getfqdn = socket.getfqdn
socket.getfqdn = mock_socket.getfqdn
- self._threads = support.threading_setup()
self.serv_evt = threading.Event()
self.client_evt = threading.Event()
# Pick a random unused port by passing 0 for the port number
@@ -703,7 +700,6 @@ class SMTPSimTests(unittest.TestCase):
# wait for the server thread to terminate
self.serv_evt.wait()
self.thread.join()
- support.threading_cleanup(*self._threads)
def testBasic(self):
# smoke test
@@ -816,6 +812,7 @@ class SMTPSimTests(unittest.TestCase):
#test infrastructure can support it.
+@support.reap_threads
def test_main(verbose=None):
support.run_unittest(GeneralTests, DebuggingServerTests,
NonConnectingTests,