samedi 4 avril 2015

Flask Testing - why does coverage exclude import statements and decorators?

My tests clearly execute each function, and there are no unused imports either. Yet, according to the coverage report, 62% of the code was never executed in the following file:


enter image description here


Can someone please point out what I might be doing wrong?


Here's how I initialise the test suite and the coverage:



cov = coverage(branch=True, omit=['website/*', 'run_test_suite.py'])
cov.start()

try:
unittest.main(argv=[sys.argv[0]])
except:
pass

cov.stop()
cov.save()

print "\n\nCoverage Report:\n"
cov.report()

print "HTML version: " + os.path.join(BASEDIR, "tmp/coverage/index.html")
cov.html_report(directory='tmp/coverage')
cov.erase()

Aucun commentaire:

Enregistrer un commentaire