Benjamin Peterson | bed7d04 | 2009-07-19 21:01:52 +0000 | [diff] [blame] | 1 | """Main entry point""" |
| 2 | |
| 3 | import sys |
| 4 | if sys.argv[0].endswith("__main__.py"): |
Michael Foord | d38e6e5 | 2012-09-28 15:14:37 +0100 | [diff] [blame] | 5 | import os.path |
| 6 | # We change sys.argv[0] to make help message more useful |
| 7 | # use executable without path, unquoted |
| 8 | # (it's just a hint anyway) |
| 9 | # (if you have spaces in your executable you get what you deserve!) |
| 10 | executable = os.path.basename(sys.executable) |
| 11 | sys.argv[0] = executable + " -m unittest" |
| 12 | del os |
Benjamin Peterson | bed7d04 | 2009-07-19 21:01:52 +0000 | [diff] [blame] | 13 | |
Benjamin Peterson | dccc1fc | 2010-03-22 00:15:53 +0000 | [diff] [blame] | 14 | __unittest = True |
| 15 | |
Serhiy Storchaka | de2800f | 2013-08-29 12:37:28 +0300 | [diff] [blame] | 16 | from .main import main, TestProgram |
Benjamin Peterson | dccc1fc | 2010-03-22 00:15:53 +0000 | [diff] [blame] | 17 | |
Benjamin Peterson | bed7d04 | 2009-07-19 21:01:52 +0000 | [diff] [blame] | 18 | main(module=None) |