4 # http://blog.wearpants.org/integrating-coverage-and-unittest-discovery
8 # python -m coverage run unittest_coverage.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_coverage.py discover
19 # It may be possible to use other coverage commands with this, as
22 """Main entry point"""
25 if sys
.argv
[0].endswith("__main__.py"):
26 sys
.argv
[0] = "python -m unittest"
30 from unittest
.main
import main
, TestProgram
, USAGE_AS_MAIN
31 TestProgram
.USAGE
= USAGE_AS_MAIN