Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (40 sloc) 1.21 KB
import sys
from optparse import OptionParser
from coverage import coverage
except ImportError:
coverage = None
parser = OptionParser()
parser.add_option('-v', '--verbose', action='store_true',
help='Be more verbose')
if coverage:
parser.add_option('-c', '--coverage', action='store_true',
help='Measure code coverage')
options, args = parser.parse_args()
if args:
if coverage and options.coverage:
cov = coverage()
# Import the Stango code down here to make coverage count the importing, too
import tests
result =
if result.wasSuccessful() and options.coverage:
exclude = [
def include_module(name):
# exclude test code and stango.autoreload which is not testable
for prefix in ['stango.tests', 'stango.autoreload']:
if name.startswith(prefix):
return False
return name.startswith('stango')
modules = [
module for name, module in sys.modules.items()
if include_module(name)
], file=sys.stdout)
Jump to Line
Something went wrong with that request. Please try again.