Commit 7abe61f6 authored by Antoine Pitrou's avatar Antoine Pitrou

Restore smtpd.DEBUGSTREAM at the end of test_smtpd.

(backport of 6b9f547e92d8)
parent 2515c4d3
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment