Renamed unittest_coverage module.
[jben2_gui.git] / python / unittest_main.py
blob2782ee0ff804470203abebb8e82a07a8c7c81537
1 #!/usr/bin/env python
3 # Source:
4 # http://blog.wearpants.org/integrating-coverage-and-unittest-discovery
6 # Run via::
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
20 # well...
22 """Main entry point"""
24 import sys
25 if sys.argv[0].endswith("__main__.py"):
26 sys.argv[0] = "python -m unittest"
28 __unittest = True
30 from unittest.main import main, TestProgram, USAGE_AS_MAIN
31 TestProgram.USAGE = USAGE_AS_MAIN
33 main(module=None)