From: Raymond Hettinger Date: Tue, 16 Sep 2003 04:55:32 +0000 (+0000) Subject: Backport addition of the __all__ attribute for unittest.py X-Git-Tag: v2.3.1~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=675bac026e8df0d8a787dd7f88fa82e04ee70191;p=thirdparty%2FPython%2Fcpython.git Backport addition of the __all__ attribute for unittest.py --- diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 8e2fd46aa496..6643a1984a1b 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -59,7 +59,7 @@ class AllTest(unittest.TestCase): self.check_all("ConfigParser") self.check_all("Cookie") self.check_all("MimeWriter") - self.check_all("Queue") + self.check_all("Queue") self.check_all("SimpleHTTPServer") self.check_all("SocketServer") self.check_all("StringIO") @@ -174,6 +174,7 @@ class AllTest(unittest.TestCase): self.check_all("tokenize") self.check_all("traceback") self.check_all("tty") + self.check_all("unittest") self.check_all("urllib") self.check_all("urlparse") self.check_all("uu") diff --git a/Lib/unittest.py b/Lib/unittest.py index d033936d2d0c..043b9a848a4f 100644 --- a/Lib/unittest.py +++ b/Lib/unittest.py @@ -55,6 +55,16 @@ import string import os import types +############################################################################## +# Exported classes and functions +############################################################################## +__all__ = ['TestResult', 'TestCase', 'TestSuite', 'TextTestRunner', + 'TestLoader', 'FunctionTestCase', 'main', 'defaultTestLoader'] + +# Expose obsolete functions for backwards compatability +__all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases']) + + ############################################################################## # Test framework core ##############################################################################