When a TC failed to initiliase the database, the following test are SKIPPED
When a TC failed to initiliase the database, the other test of the same TestCase
are skipped with an explicite message instead of failing later for with an
unrelated message.
--- a/devtools/testlib.py Thu Mar 25 15:08:27 2010 +0100
+++ b/devtools/testlib.py Thu Mar 25 15:11:44 2010 +0100
@@ -248,7 +248,14 @@
def setUp(self):
pause_tracing()
- self._init_repo()
+ previous_failure = self.__class__.__dict__.get('_repo_init_failed')
+ if previous_failure is not None:
+ self.skip('repository is not initialised: %r' % previous_failure)
+ try:
+ self._init_repo()
+ except Exception, ex:
+ self.__class__._repo_init_failed = ex
+ raise
resume_tracing()
self.setup_database()
self.commit()