]> granicus.if.org Git - python/commitdiff
#8739: fix omission of DEBUGSTREAM reset in new test in test_smtpd.
authorR David Murray <rdmurray@bitdance.com>
Mon, 4 Jun 2012 19:55:51 +0000 (15:55 -0400)
committerR David Murray <rdmurray@bitdance.com>
Mon, 4 Jun 2012 19:55:51 +0000 (15:55 -0400)
This clears up an error in detected by refleak mode that showed up when
test_smtplib was run after test_smtpd in the same refleak run.

Lib/test/test_smtpd.py

index dda194139c6783d786343c023cd2c2ac2cd21c74..93f14c4562bccefcb77adb16126067ca1ee97aee 100644 (file)
@@ -507,6 +507,7 @@ class SMTPDChannelWithDataSizeLimitTest(unittest.TestCase):
 
     def setUp(self):
         smtpd.socket = asyncore.socket = mock_socket
+        self.old_debugstream = smtpd.DEBUGSTREAM
         self.debug = smtpd.DEBUGSTREAM = io.StringIO()
         self.server = DummyServer('a', 'b')
         conn, addr = self.server.accept()
@@ -516,6 +517,7 @@ class SMTPDChannelWithDataSizeLimitTest(unittest.TestCase):
     def tearDown(self):
         asyncore.close_all()
         asyncore.socket = smtpd.socket = socket
+        smtpd.DEBUGSTREAM = self.old_debugstream
 
     def write_line(self, line):
         self.channel.socket.queue_recv(line)