Restore smtpd.DEBUGSTREAM at the end of test_smtpd.

(backport of 6b9f547e92d8)
This commit is contained in:
Antoine Pitrou 2011-11-12 20:36:29 +01:00
parent 2515c4d34e
commit 7abe61f6b5
1 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,7 @@ class SMTPDServerTest(TestCase):
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 @@ class SMTPDChannelTest(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)