From 8596d572e1733db8b43e9dc070f66b5de7c57406 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Mon, 25 May 2015 22:03:25 +0200 Subject: [PATCH] Code coverage in test cases. --- test/test.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/test.py b/test/test.py index ffbf4a2..cd96db6 100644 --- a/test/test.py +++ b/test/test.py @@ -256,12 +256,21 @@ class WebAppTest(unittest.TestCase): if __name__ == '__main__': import coverage - cov = coverage.coverage(omit=['*test*']) + cov = coverage.coverage(omit=['*test*', 'main']) cov.start() + sys.path.insert(0, '../src') + import scriptform unittest.main(exit=False) cov.stop() cov.save() 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