<s> """<STR_LIT>""" <EOL> import linecache <EOL> import os <EOL> import re <EOL> import sys <EOL> import threading <EOL> import token <EOL> import tokenize <EOL> import types <EOL> import gc <EOL> try : <EOL> import cPickle <EOL> pickle = cPickle <EOL> except ImportError : <EOL> import pickle <EOL> def usage ( outfile ) : <EOL> outfile . write ( """<STR_LIT>""" % sys . argv [ <NUM_LIT:0> ] ) <EOL> PRAGMA_NOCOVER = "<STR_LIT>" <EOL> rx_blank = re . compile ( r'<STR_LIT>' ) <EOL> class Ignore : <EOL> def __init__ ( self , modules = None , dirs = None ) : <EOL> self . _mods = modules or [ ] <EOL> self . _dirs = dirs or [ ] <EOL> self . _dirs = map ( os . path . normpath , self . _dirs ) <EOL> self . _ignore = { '<STR_LIT>' : <NUM_LIT:1> } <EOL> def names ( self , filename , modulename ) : <EOL> if self . _ignore . has_key ( modulename ) : <EOL> return self . _ignore [ modulename ] <EOL> for mod in self . _mods : <EOL> if mod == modulename : <EOL> self . _ignore [ modulename ] = <NUM_LIT:1> <EOL> return <NUM_LIT:1> <EOL> n = len ( mod ) <EOL> if mod == modulename [ : n ] and modulename [ n ] == '<STR_LIT:.>' : <EOL> self . _ignore [ modulename ] = <NUM_LIT:1> <EOL> return <NUM_LIT:1> <EOL> if filename is None : <EOL> self . _ignore [ modulename ] = <NUM_LIT:1> <EOL> return <NUM_LIT:1> <EOL> for d in self . _dirs : <EOL> if filename . startswith ( d + os . sep ) : <EOL> self . _ignore [ modulename ] = <NUM_LIT:1> <EOL> return <NUM_LIT:1> <EOL> self . _ignore [ modulename ] = <NUM_LIT:0> <EOL> return <NUM_LIT:0> <EOL> def modname ( path ) : <EOL> """<STR_LIT>""" <EOL> base = os . path . basename ( path ) <EOL> filename , ext = os . path . splitext ( base ) <EOL> return filename <EOL> def fullmodname ( path ) : <EOL> """<STR_LIT>""" <EOL> comparepath = os . path . normcase ( path ) <EOL> longest = "<STR_LIT>" <EOL> for dir in sys . path : <EOL> dir = os . path . normcase ( dir ) <EOL> if comparepath . startswith ( dir ) and comparepath [ len ( dir ) ] == os . sep : <EOL> if len ( dir ) > len ( longest ) : <EOL> longest = dir <EOL> if longest : <EOL> base = path [ len ( longest ) + <NUM_LIT:1> : ] <EOL> else : <EOL> base = path <EOL> base = base . replace ( os . sep , "<STR_LIT:.>" ) <EOL> if os . altsep : <EOL> base = base . replace ( os . altsep , "<STR_LIT:.>" ) <EOL> filename , ext = os . path . splitext ( base ) <EOL> return filename <EOL> class CoverageResults : <EOL> def __init__ ( self , counts = None , calledfuncs = None , infile = None , <EOL> callers = None , outfile = None ) : <EOL> self . counts = counts <EOL> if self . counts is None : <EOL> self . counts = { } <EOL> self . counter = self . counts . copy ( ) <EOL> self . calledfuncs = calledfuncs <EOL> if self . calledfuncs is None : <EOL> self . calledfuncs = { } <EOL> self . calledfuncs = self . calledfuncs . copy ( ) <EOL> self . callers = callers <EOL> if self . callers is None : <EOL> self . callers = { } <EOL> self . callers = self . callers . copy ( ) <EOL> self . infile = infile <EOL> self . outfile = outfile <EOL> if self . infile : <EOL> try : <EOL> counts , calledfuncs , callers = pickle . load ( open ( self . infile , '<STR_LIT:rb>' ) ) <EOL> self . update ( self . __class__ ( counts , calledfuncs , callers ) ) <EOL> except ( IOError , EOFError , ValueError ) , err : <EOL> print >> sys . stderr , ( "<STR_LIT>" <EOL> % ( self . infile , err ) ) <EOL> def update ( self , other ) : <EOL> """<STR_LIT>""" <EOL> counts = self . counts <EOL> calledfuncs = self . calledfuncs <EOL> callers = self . callers <EOL> other_counts = other . counts <EOL> other_calledfuncs = other . calledfuncs <EOL> other_callers = other . callers <EOL> for key in other_counts . keys ( ) : <EOL> counts [ key ] = counts . get ( key , <NUM_LIT:0> ) + other_counts [ key ] <EOL> for key in other_calledfuncs . keys ( ) : <EOL> calledfuncs [ key ] = <NUM_LIT:1> <EOL> for key in other_callers . keys ( ) : <EOL> callers [ key ] = <NUM_LIT:1> <EOL> def write_results ( self , show_missing = True , summary = False , coverdir = None ) : <EOL> """<STR_LIT>""" <EOL> if self . calledfuncs : <EOL> print <EOL> print "<STR_LIT>" <EOL> calls = self . calledfuncs . keys ( ) <EOL> calls . sort ( ) <EOL> for filename , modulename , funcname in calls : <EOL> print ( "<STR_LIT>" <EOL> % ( filename , modulename , funcname ) ) <EOL> if self . callers : <EOL> print <EOL> print "<STR_LIT>" <EOL> calls = self . callers . keys ( ) <EOL> calls . sort ( ) <EOL> lastfile = lastcfile = "<STR_LIT>" <EOL> for ( ( pfile , pmod , pfunc ) , ( cfile , cmod , cfunc ) ) in calls : <EOL> if pfile != lastfile : <EOL> print <EOL> print "<STR_LIT>" , pfile , "<STR_LIT>" <EOL> lastfile = pfile <EOL> lastcfile = "<STR_LIT>" <EOL> if cfile != pfile and lastcfile != cfile : <EOL> print "<STR_LIT>" , cfile <EOL> lastcfile = cfile <EOL> print "<STR_LIT>" % ( pmod , pfunc , cmod , cfunc ) <EOL> per_file = { } <EOL> for filename , lineno in self . counts . keys ( ) : <EOL> lines_hit = per_file [ filename ] = per_file . get ( filename , { } ) <EOL> lines_hit [ lineno ] = self . counts [ ( filename , lineno ) ] <EOL> sums = { } <EOL> for filename , count in per_file . iteritems ( ) : <EOL> if filename == "<STR_LIT>" : <EOL> continue <EOL> if filename . startswith ( "<STR_LIT>" ) : <EOL> continue <EOL> if filename . endswith ( ( "<STR_LIT>" , "<STR_LIT>" ) ) : <EOL> filename = filename [ : - <NUM_LIT:1> ] <EOL> if coverdir is None : <EOL> dir = os . path . dirname ( os . path . abspath ( filename ) ) <EOL> modulename = modname ( filename ) <EOL> else : <EOL> dir = coverdir <EOL> if not os . path . exists ( dir ) : <EOL> os . makedirs ( dir ) <EOL> modulename = fullmodname ( filename ) <EOL> if show_missing : <EOL> lnotab = find_executable_linenos ( filename ) <EOL> else : <EOL> lnotab = { } <EOL> source = linecache . getlines ( filename ) <EOL> coverpath = os . path . join ( dir , modulename + "<STR_LIT>" ) <EOL> n_hits , n_lines = self . write_results_file ( coverpath , source , <EOL> lnotab , count ) <EOL> if summary and n_lines : <EOL> percent = int ( <NUM_LIT:100> * n_hits / n_lines ) <EOL> sums [ modulename ] = n_lines , percent , modulename , filename <EOL> if summary and sums : <EOL> mods = sums . keys ( ) <EOL> mods . sort ( ) <EOL> print "<STR_LIT>" <EOL> for m in mods : <EOL> n_lines , percent , modulename , filename = sums [ m ] <EOL> print "<STR_LIT>" % sums [ m ] <EOL> if self . outfile : <EOL> try : <EOL> pickle . dump ( ( self . counts , self . calledfuncs , self . callers ) , <EOL> open ( self . outfile , '<STR_LIT:wb>' ) , <NUM_LIT:1> ) <EOL> except IOError , err : <EOL> print >> sys . stderr , "<STR_LIT>" % err <EOL> def write_results_file ( self , path , lines , lnotab , lines_hit ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> outfile = open ( path , "<STR_LIT:w>" ) <EOL> except IOError , err : <EOL> print >> sys . stderr , ( "<STR_LIT>" <EOL> "<STR_LIT>" % ( path , err ) ) <EOL> return <NUM_LIT:0> , <NUM_LIT:0> <EOL> n_lines = <NUM_LIT:0> <EOL> n_hits = <NUM_LIT:0> <EOL> for i , line in enumerate ( lines ) : <EOL> lineno = i + <NUM_LIT:1> <EOL> if lineno in lines_hit : <EOL> outfile . write ( "<STR_LIT>" % lines_hit [ lineno ] ) <EOL> n_hits += <NUM_LIT:1> <EOL> n_lines += <NUM_LIT:1> <EOL> elif rx_blank . match ( line ) : <EOL> outfile . write ( "<STR_LIT:U+0020>" ) <EOL> else : <EOL> if lineno in lnotab and not PRAGMA_NOCOVER in lines [ i ] : <EOL> outfile . write ( "<STR_LIT>" ) <EOL> n_lines += <NUM_LIT:1> <EOL> else : <EOL> outfile . write ( "<STR_LIT:U+0020>" ) <EOL> outfile . write ( lines [ i ] . expandtabs ( <NUM_LIT:8> ) ) <EOL> outfile . close ( ) <EOL> return n_hits , n_lines <EOL> def find_lines_from_code ( code , strs ) : <EOL> """<STR_LIT>""" <EOL> linenos = { } <EOL> line_increments = [ ord ( c ) for c in code . co_lnotab [ <NUM_LIT:1> : : <NUM_LIT:2> ] ] <EOL> table_length = len ( line_increments ) <EOL> docstring = False <EOL> lineno = code . co_firstlineno <EOL> for li in line_increments : <EOL> lineno += li <EOL> if lineno not in strs : <EOL> linenos [ lineno ] = <NUM_LIT:1> <EOL> return linenos <EOL> def find_lines ( code , strs ) : <EOL> """<STR_LIT>""" <EOL> linenos = find_lines_from_code ( code , strs ) <EOL> for c in code . co_consts : <EOL> if isinstance ( c , types . CodeType ) : <EOL> linenos . update ( find_lines ( c , strs ) ) <EOL> return linenos <EOL> def find_strings ( filename ) : <EOL> """<STR_LIT>""" <EOL> d = { } <EOL> prev_ttype = token . INDENT <EOL> f = open ( filename ) <EOL> for ttype , tstr , start , end , line in tokenize . generate_tokens ( f . readline ) : <EOL> if ttype == token . STRING : <EOL> if prev_ttype == token . INDENT : <EOL> sline , scol = start <EOL> eline , ecol = end <EOL> for i in range ( sline , eline + <NUM_LIT:1> ) : <EOL> d [ i ] = <NUM_LIT:1> <EOL> prev_ttype = ttype <EOL> f . close ( ) <EOL> return d <EOL> def find_executable_linenos ( filename ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> prog = open ( filename , "<STR_LIT>" ) . read ( ) <EOL> except IOError , err : <EOL> print >> sys . stderr , ( "<STR_LIT>" <EOL> % ( filename , err ) ) <EOL> return { } <EOL> code = compile ( prog , filename , "<STR_LIT>" ) <EOL> strs = find_strings ( filename ) <EOL> return find_lines ( code , strs ) <EOL> class Trace : <EOL> def __init__ ( self , count = <NUM_LIT:1> , trace = <NUM_LIT:1> , countfuncs = <NUM_LIT:0> , countcallers = <NUM_LIT:0> , <EOL> ignoremods = ( ) , ignoredirs = ( ) , infile = None , outfile = None ) : <EOL> """<STR_LIT>""" <EOL> self . infile = infile <EOL> self . outfile = outfile <EOL> self . ignore = Ignore ( ignoremods , ignoredirs ) <EOL> self . counts = { } <EOL> self . blabbed = { } <EOL> self . pathtobasename = { } <EOL> self . donothing = <NUM_LIT:0> <EOL> self . trace = trace <EOL> self . _calledfuncs = { } <EOL> self . _callers = { } <EOL> self . _caller_cache = { } <EOL> if countcallers : <EOL> self . globaltrace = self . globaltrace_trackcallers <EOL> elif countfuncs : <EOL> self . globaltrace = self . globaltrace_countfuncs <EOL> elif trace and count : <EOL> self . globaltrace = self . globaltrace_lt <EOL> self . localtrace = self . localtrace_trace_and_count <EOL> elif trace : <EOL> self . globaltrace = self . globaltrace_lt <EOL> self . localtrace = self . localtrace_trace <EOL> elif count : <EOL> self . globaltrace = self . globaltrace_lt <EOL> self . localtrace = self . localtrace_count <EOL> else : <EOL> self . donothing = <NUM_LIT:1> <EOL> def run ( self , cmd ) : <EOL> import __main__ <EOL> dict = __main__ . __dict__ <EOL> if not self . donothing : <EOL> sys . settrace ( self . globaltrace ) <EOL> threading . settrace ( self . globaltrace ) <EOL> try : <EOL> exec cmd in dict , dict <EOL> finally : <EOL> if not self . donothing : <EOL> sys . settrace ( None ) <EOL> threading . settrace ( None ) <EOL> def runctx ( self , cmd , globals = None , locals = None ) : <EOL> if globals is None : globals = { } <EOL> if locals is None : locals = { } <EOL> if not self . donothing : <EOL> sys . settrace ( self . globaltrace ) <EOL> threading . settrace ( self . globaltrace ) <EOL> try : <EOL> exec cmd in globals , locals <EOL> finally : <EOL> if not self . donothing : <EOL> sys . settrace ( None ) <EOL> threading . settrace ( None ) <EOL> def runfunc ( self , func , * args , ** kw ) : <EOL> result = None <EOL> if not self . donothing : <EOL> sys . settrace ( self . globaltrace ) <EOL> try : <EOL> result = func ( * args , ** kw ) <EOL> finally : <EOL> if not self . donothing : <EOL> sys . settrace ( None ) <EOL> return result <EOL> def file_module_function_of ( self , frame ) : <EOL> code = frame . f_code <EOL> filename = code . co_filename <EOL> if filename : <EOL> modulename = modname ( filename ) <EOL> else : <EOL> modulename = None <EOL> funcname = code . co_name <EOL> clsname = None <EOL> if code in self . _caller_cache : <EOL> if self . _caller_cache [ code ] is not None : <EOL> clsname = self . _caller_cache [ code ] <EOL> else : <EOL> self . _caller_cache [ code ] = None <EOL> funcs = [ f for f in gc . get_referrers ( code ) <EOL> if hasattr ( f , "<STR_LIT>" ) ] <EOL> if len ( funcs ) == <NUM_LIT:1> : <EOL> dicts = [ d for d in gc . get_referrers ( funcs [ <NUM_LIT:0> ] ) <EOL> if isinstance ( d , dict ) ] <EOL> if len ( dicts ) == <NUM_LIT:1> : <EOL> classes = [ c for c in gc . get_referrers ( dicts [ <NUM_LIT:0> ] ) <EOL> if hasattr ( c , "<STR_LIT>" ) ] <EOL> if len ( classes ) == <NUM_LIT:1> : <EOL> clsname = str ( classes [ <NUM_LIT:0> ] ) <EOL> self . _caller_cache [ code ] = clsname <EOL> if clsname is not None : <EOL> clsname = clsname . split ( "<STR_LIT:.>" ) [ <NUM_LIT:1> : ] <EOL> clsname = "<STR_LIT:.>" . join ( clsname ) <EOL> funcname = "<STR_LIT>" % ( clsname , funcname ) <EOL> return filename , modulename , funcname <EOL> def globaltrace_trackcallers ( self , frame , why , arg ) : <EOL> """<STR_LIT>""" <EOL> if why == '<STR_LIT>' : <EOL> this_func = self . file_module_function_of ( frame ) <EOL> parent_func = self . file_module_function_of ( frame . f_back ) <EOL> self . _callers [ ( parent_func , this_func ) ] = <NUM_LIT:1> <EOL> def globaltrace_countfuncs ( self , frame , why , arg ) : <EOL> """<STR_LIT>""" <EOL> if why == '<STR_LIT>' : <EOL> this_func = self . file_module_function_of ( frame ) <EOL> self . _calledfuncs [ this_func ] = <NUM_LIT:1> <EOL> def globaltrace_lt ( self , frame , why , arg ) : <EOL> """<STR_LIT>""" <EOL> if why == '<STR_LIT>' : <EOL> code = frame . f_code <EOL> filename = frame . f_globals . get ( '<STR_LIT>' , None ) <EOL> if filename : <EOL> modulename = modname ( filename ) <EOL> if modulename is not None : <EOL> ignore_it = self . ignore . names ( filename , modulename ) <EOL> if not ignore_it : <EOL> if self . trace : <EOL> print ( "<STR_LIT>" <EOL> % ( modulename , code . co_name ) ) <EOL> return self . localtrace <EOL> else : <EOL> return None <EOL> def localtrace_trace_and_count ( self , frame , why , arg ) : <EOL> if why == "<STR_LIT>" : <EOL> filename = frame . f_code . co_filename <EOL> lineno = frame . f_lineno <EOL> key = filename , lineno <EOL> self . counts [ key ] = self . counts . get ( key , <NUM_LIT:0> ) + <NUM_LIT:1> <EOL> bname = os . path . basename ( filename ) <EOL> print "<STR_LIT>" % ( bname , lineno , <EOL> linecache . getline ( filename , lineno ) ) , <EOL> return self . localtrace <EOL> def localtrace_trace ( self , frame , why , arg ) : <EOL> if why == "<STR_LIT>" : <EOL> filename = frame . f_code . co_filename <EOL> lineno = frame . f_lineno <EOL> bname = os . path . basename ( filename ) <EOL> print "<STR_LIT>" % ( bname , lineno , <EOL> linecache . getline ( filename , lineno ) ) , <EOL> return self . localtrace <EOL> def localtrace_count ( self , frame , why , arg ) : <EOL> if why == "<STR_LIT>" : <EOL> filename = frame . f_code . co_filename <EOL> lineno = frame . f_lineno <EOL> key = filename , lineno <EOL> self . counts [ key ] = self . counts . get ( key , <NUM_LIT:0> ) + <NUM_LIT:1> <EOL> return self . localtrace <EOL> def results ( self ) : <EOL> return CoverageResults ( self . counts , infile = self . infile , <EOL> outfile = self . outfile , <EOL> calledfuncs = self . _calledfuncs , <EOL> callers = self . _callers ) <EOL> def _err_exit ( msg ) : <EOL> sys . stderr . write ( "<STR_LIT>" % ( sys . argv [ <NUM_LIT:0> ] , msg ) ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def main ( argv = None ) : <EOL> import getopt <EOL> if argv is None : <EOL> argv = sys . argv <EOL> try : <EOL> opts , prog_argv = getopt . getopt ( argv [ <NUM_LIT:1> : ] , "<STR_LIT>" , <EOL> [ "<STR_LIT>" , "<STR_LIT:version>" , "<STR_LIT>" , "<STR_LIT:count>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" ] ) <EOL> except getopt . error , msg : <EOL> sys . stderr . write ( "<STR_LIT>" % ( sys . argv [ <NUM_LIT:0> ] , msg ) ) <EOL> sys . stderr . write ( "<STR_LIT>" <EOL> % sys . argv [ <NUM_LIT:0> ] ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> trace = <NUM_LIT:0> <EOL> count = <NUM_LIT:0> <EOL> report = <NUM_LIT:0> <EOL> no_report = <NUM_LIT:0> <EOL> counts_file = None <EOL> missing = <NUM_LIT:0> <EOL> ignore_modules = [ ] <EOL> ignore_dirs = [ ] <EOL> coverdir = None <EOL> summary = <NUM_LIT:0> <EOL> listfuncs = False <EOL> countcallers = False <EOL> for opt , val in opts : <EOL> if opt == "<STR_LIT>" : <EOL> usage ( sys . stdout ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> if opt == "<STR_LIT>" : <EOL> sys . stdout . write ( "<STR_LIT>" ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> if opt == "<STR_LIT>" or opt == "<STR_LIT>" : <EOL> countcallers = True <EOL> continue <EOL> if opt == "<STR_LIT>" or opt == "<STR_LIT>" : <EOL> listfuncs = True <EOL> continue <EOL> if opt == "<STR_LIT>" or opt == "<STR_LIT>" : <EOL> trace = <NUM_LIT:1> <EOL> continue <EOL> if opt == "<STR_LIT:-c>" or opt == "<STR_LIT>" : <EOL> count = <NUM_LIT:1> <EOL> continue <EOL> if opt == "<STR_LIT>" or opt == "<STR_LIT>" : <EOL> report = <NUM_LIT:1> <EOL> continue <EOL> if opt == "<STR_LIT>" or opt == "<STR_LIT>" : <EOL> no_report = <NUM_LIT:1> <EOL> continue <EOL> if opt == "<STR_LIT>" or opt == "<STR_LIT>" : <EOL> counts_file = val <EOL> continue <EOL> if opt == "<STR_LIT>" or opt == "<STR_LIT>" : <EOL> missing = <NUM_LIT:1> <EOL> continue <EOL> if opt == "<STR_LIT>" or opt == "<STR_LIT>" : <EOL> coverdir = val <EOL> continue <EOL> if opt == "<STR_LIT>" or opt == "<STR_LIT>" : <EOL> summary = <NUM_LIT:1> <EOL> continue <EOL> if opt == "<STR_LIT>" : <EOL> ignore_modules . append ( val ) <EOL> continue <EOL> if opt == "<STR_LIT>" : <EOL> for s in val . split ( os . pathsep ) : <EOL> s = os . path . expandvars ( s ) <EOL> s = s . replace ( "<STR_LIT>" , <EOL> os . path . join ( sys . prefix , "<STR_LIT>" , <EOL> "<STR_LIT>" + sys . version [ : <NUM_LIT:3> ] ) ) <EOL> s = s . replace ( "<STR_LIT>" , <EOL> os . path . join ( sys . exec_prefix , "<STR_LIT>" , <EOL> "<STR_LIT>" + sys . version [ : <NUM_LIT:3> ] ) ) <EOL> s = os . path . normpath ( s ) <EOL> ignore_dirs . append ( s ) <EOL> continue <EOL> assert <NUM_LIT:0> , "<STR_LIT>" <EOL> if listfuncs and ( count or trace ) : <EOL> _err_exit ( "<STR_LIT>" ) <EOL> if not ( count or trace or report or listfuncs or countcallers ) : <EOL> _err_exit ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> if report and no_report : <EOL> _err_exit ( "<STR_LIT>" ) <EOL> if report and not counts_file : <EOL> _err_exit ( "<STR_LIT>" ) <EOL> if no_report and len ( prog_argv ) == <NUM_LIT:0> : <EOL> _err_exit ( "<STR_LIT>" ) <EOL> if report : <EOL> results = CoverageResults ( infile = counts_file , outfile = counts_file ) <EOL> results . write_results ( missing , summary = summary , coverdir = coverdir ) <EOL> else : <EOL> sys . argv = prog_argv <EOL> progname = prog_argv [ <NUM_LIT:0> ] <EOL> sys . path [ <NUM_LIT:0> ] = os . path . split ( progname ) [ <NUM_LIT:0> ] <EOL> t = Trace ( count , trace , countfuncs = listfuncs , <EOL> countcallers = countcallers , ignoremods = ignore_modules , <EOL> ignoredirs = ignore_dirs , infile = counts_file , <EOL> outfile = counts_file ) <EOL> try : <EOL> t . run ( '<STR_LIT>' % ( progname , ) ) <EOL> except IOError , err : <EOL> _err_exit ( "<STR_LIT>" % ( sys . argv [ <NUM_LIT:0> ] , err ) ) <EOL> except SystemExit : <EOL> pass <EOL> results = t . results ( ) <EOL> if not no_report : <EOL> results . write_results ( missing , summary = summary , coverdir = coverdir ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
