def main_check():
 try:
  with open('coverage.xml', encoding='utf-8') as f:
   messages = check(f, PERFECT_FILES)
 except Skipped as e:
  print e
  messages = []
 if messages:
  print ()
  print ()
  utils.print_title('Coverage check failed')
  for msg in messages:
   print msg.text
  print ()
  filters = ','.join((msg.filename for msg in messages))
  subprocess.check_call([sys.executable, '-m', 'coverage', 'report', '--show-missing', '--include', filters])
  print ()
  print "To debug this, run 'tox -e py35-cov' (or py34-cov) locally and check htmlcov/index.html"
  print 'or check https://codecov.io/github/The-Compiler/qutebrowser'
  print ()
 if ('CI' in os.environ):
  print 'Keeping coverage.xml on CI.'
 else:
  os.remove('coverage.xml')
 return (1 if messages else 0)

def main_check ( ) : try : with open ( 'coverage.xml' , encoding = 'utf-8' ) as f : messages = check ( f , PERFECT_FILES ) except Skipped as e : print e messages = [ ] if messages : print ( ) print ( ) utils . print_title ( 'Coverage check failed' ) for msg in messages : print msg . text print ( ) filters = ',' . join ( ( msg . filename for msg in messages ) ) subprocess . check_call ( [ sys . executable , '-m' , 'coverage' , 'report' , '--show-missing' , '--include' , filters ] ) print ( ) print "To debug this, run 'tox -e py35-cov' (or py34-cov) locally and check htmlcov/index.html" print 'or check https://codecov.io/github/The-Compiler/qutebrowser' print ( ) if ( 'CI' in os . environ ) : print 'Keeping coverage.xml on CI.' else : os . remove ( 'coverage.xml' ) return ( 1 if messages else 0 )
check coverage after a test run .