From 7df82c9ef85fdcb0d7f4208d8ae1633959941e8e Mon Sep 17 00:00:00 2001 From: Michael Foord Date: Tue, 12 May 2009 10:46:23 +0000 Subject: Fix to restore command line behaviour for test modules using unittest.main(). Regression caused by issue 5995. Michael --- Lib/unittest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/unittest.py b/Lib/unittest.py index 84520d8..d781354 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() -- cgit v0.12