4 # http://blog.wearpants.org/integrating-coverage-and-unittest-discovery
8 # python -m coverage run unittest_main.py [args]
10 # What was done: Python/Lib/unittest/__main__.py was copied VERBATIM
11 # here. This means that running this script via coverage effectively
12 # provides a wrapper around "python -m unittest". Pass arguments
13 # afterwards like normal.
15 # Unit test coverage with automatic discovery::
17 # python -m coverage run unittest_main.py discover
19 """Main entry point"""
22 if sys
.argv
[0].endswith("__main__.py"):
23 sys
.argv
[0] = "python -m unittest"
27 from unittest
.main
import main
, TestProgram
, USAGE_AS_MAIN
28 TestProgram
.USAGE
= USAGE_AS_MAIN