[Python-checkins] cpython: Restore smtpd.DEBUGSTREAM at the end of test_smtpd.
antoine.pitrou
python-checkins at python.org
Sat Nov 12 20:41:27 CET 2011
http://hg.python.org/cpython/rev/6b9f547e92d8
changeset: 73530:6b9f547e92d8
parent: 73522:ac12dcea69e1
user: Antoine Pitrou <solipsis at pitrou.net>
date: Sat Nov 12 20:36:29 2011 +0100
summary:
Restore smtpd.DEBUGSTREAM at the end of test_smtpd.
This fixes a subsequent refleak in test_smtplib.
files:
Lib/test/test_smtpd.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_smtpd.py b/Lib/test/test_smtpd.py
--- a/Lib/test/test_smtpd.py
+++ b/Lib/test/test_smtpd.py
@@ -52,6 +52,7 @@
class SMTPDChannelTest(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()
@@ -60,6 +61,7 @@
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)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list