[conduit: 112/138] Decorate a test with calls to coverage.start() and coverage.stop() - seems to decrease chance of bt.
- From: John Carr <johncarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [conduit: 112/138] Decorate a test with calls to coverage.start() and coverage.stop() - seems to decrease chance of bt.
- Date: Thu, 21 May 2009 03:36:19 -0400 (EDT)
commit 3e5723a98263dd5abff4ddb022b4e3840df78bc7
Author: John Carr <john carr unrouted co uk>
Date: Wed May 6 05:42:05 2009 -0700
Decorate a test with calls to coverage.start() and coverage.stop() - seems to decrease chance of bt. Fix module globbing.
---
test/soup/env/cov.py | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/test/soup/env/cov.py b/test/soup/env/cov.py
index 8fc656b..237a2ef 100644
--- a/test/soup/env/cov.py
+++ b/test/soup/env/cov.py
@@ -24,11 +24,19 @@ class Coverage(soup.env.EnvironmentWrapper):
def prepare_environment(self):
import coverage
coverage.erase()
- coverage.start()
+
+ def decorate_test(self, test):
+ def _(*args, **kwargs):
+ coverage.start()
+ test(*args, **kwargs)
+ coverage.stop()
+ return _
def finalize_environment(self):
- coverage.stop()
- modules = glob("conduit/*.py") + glob("conduit/*/*.py") + glob("conduit/*/*/*.py")
+ root = soup.get_root() + '/conduit'
+ modules = []
+ for i in range(3):
+ modules.extend(glob(root + '/*' * i + '.py'))
coverage.report(modules, ignore_errors=1, show_missing=0)
coverage.erase()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]