diff -r 22b6b59c70e6 Lib/test/test_imaplib.py --- a/Lib/test/test_imaplib.py Fri Mar 01 14:53:45 2013 +0200 +++ b/Lib/test/test_imaplib.py Fri Mar 01 15:23:53 2013 -0600 @@ -444,7 +444,7 @@ keyfile=CERTFILE, ssl_context=self.create_ssl_context()) -def test_main(): +def load_tests(*args): tests = [TestImaplib] if support.is_resource_enabled('network'): @@ -459,9 +459,9 @@ RemoteIMAPTest, RemoteIMAP_SSLTest, RemoteIMAP_STARTTLSTest, ]) - support.run_unittest(*tests) + return unittest.TestSuite([unittest.makeSuite(test) for test in tests]) if __name__ == "__main__": support.use_resources = ['network'] - test_main() + unittest.main()