commit | f596a5125a50c8e2026984531e9be3fc111b3d49 | [log] [tgz] |
---|---|---|
author | Michael Foord <fuzzyman@voidspace.org.uk> | Tue May 12 10:49:13 2009 +0000 |
committer | Michael Foord <fuzzyman@voidspace.org.uk> | Tue May 12 10:49:13 2009 +0000 |
tree | 960e3db9021da912efabc927232ea67e68b0475a | |
parent | 7df82c9ef85fdcb0d7f4208d8ae1633959941e8e [diff] [blame] |
Better fix for modules using unittest.main(). Fixes regression caused by commit for issue 5995. Michael Foord
diff --git a/Lib/unittest.py b/Lib/unittest.py index d781354..5858d89 100644 --- a/Lib/unittest.py +++ b/Lib/unittest.py
@@ -1567,7 +1567,7 @@ return if len(args) > 0: self.testNames = args - if os.path.splitext(os.path.basename(__file__))[0] == 'unitest': + if sys.modules['unittest'] is sys.modules['__main__']: self.module = None else: self.testNames = (self.defaultTest,)