Code coverage in test cases.

pull/7/head
Ferry Boender 10 years ago
parent 0ac27bc033
commit 8596d572e1
  1. 11
      test/test.py

@ -256,12 +256,21 @@ class WebAppTest(unittest.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
import coverage import coverage
cov = coverage.coverage(omit=['*test*']) cov = coverage.coverage(omit=['*test*', 'main'])
cov.start() cov.start()
sys.path.insert(0, '../src')
import scriptform
unittest.main(exit=False) unittest.main(exit=False)
cov.stop() cov.stop()
cov.save() cov.save()
print cov.report() print cov.report()
try:
print cov.html_report()
except coverage.misc.CoverageException, e:
if "Couldn't find static file 'jquery.hotkeys.js'" in e.message:
pass
else:
raise

Loading…
Cancel
Save