summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2012-06-19 10:34:11 -0400
committerThibault Saunier <thibault.saunier@collabora.com>2012-06-21 10:00:09 -0400
commit18c763bef3395a6b586f4c437b749de764e6ba65 (patch)
treee26d96bec6367be6003334de1f7670fb9473b037
parent345a3e8600b0948b348edf13e800e70e3230e97e (diff)
insanity: Add a way to execute code in a monitor between the last Test.stop() call and the actual teardown
-rw-r--r--insanity/monitor.py7
-rw-r--r--insanity/test.py5
2 files changed, 12 insertions, 0 deletions
diff --git a/insanity/monitor.py b/insanity/monitor.py
index 29bd009..6904caf 100644
--- a/insanity/monitor.py
+++ b/insanity/monitor.py
@@ -140,6 +140,13 @@ class Monitor(object):
"""
return True
+ def prepareTearDown(self):
+ """
+ This method is called between the last iteration call of stop and finallize
+ the teardown with tearDown
+ """
+ pass
+
def tearDown(self):
"""
Clean up the monitor.
diff --git a/insanity/test.py b/insanity/test.py
index 57f13b7..c0e06b6 100644
--- a/insanity/test.py
+++ b/insanity/test.py
@@ -394,6 +394,11 @@ class Test(gobject.GObject):
Your teardown MUST happen in a synchronous fashion.
"""
+
+ # Tell monitors that we are starting the teardown process
+ for instance in self._monitorinstances:
+ instance.prepareTearDown()
+
self.tearDownVmethod()
stoptime = time.time()