From: Michael Foord Date: Tue, 12 May 2009 10:46:23 +0000 (+0000) Subject: Fix to restore command line behaviour for test modules using unittest.main(). Regress... X-Git-Tag: v2.7a1~1207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7df82c9ef85fdcb0d7f4208d8ae1633959941e8e;p=thirdparty%2FPython%2Fcpython.git Fix to restore command line behaviour for test modules using unittest.main(). Regression caused by issue 5995. Michael --- diff --git a/Lib/unittest.py b/Lib/unittest.py index 84520d861699..d781354ba420 100644 --- a/Lib/unittest.py +++ b/Lib/unittest.py @@ -1567,7 +1567,8 @@ Examples: return if len(args) > 0: self.testNames = args - self.module = None + if os.path.splitext(os.path.basename(__file__))[0] == 'unitest': + self.module = None else: self.testNames = (self.defaultTest,) self.createTests()