Better fix for modules using unittest.main(). Fixes regression caused by commit for issue 5995. Michael Foord

This commit is contained in:
Michael Foord 2009-05-12 10:49:13 +00:00
parent 7df82c9ef8
commit f596a5125a
1 changed files with 1 additions and 1 deletions

View File

@ -1567,7 +1567,7 @@ Examples:
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,)