diff options
author | chrisw <unknown> | 2010-09-09 21:44:28 +0100 |
---|---|---|
committer | chrisw <unknown> | 2010-09-09 21:44:28 +0100 |
commit | 514498d6bee3402343ebf54e50c3d7e4f3472a9d (patch) | |
tree | 6a3707ed95075013c42acfc30b612161ea3720e2 /migrate/tests | |
parent | 4d938a3baf4bec5bb9e33a1ed0c01be0c3f31521 (diff) | |
download | sqalchemy-migrate-514498d6bee3402343ebf54e50c3d7e4f3472a9d.tar.gz |
don't stop if one db fails, run for all so we can tell how badly things went wrong on Hudson
Diffstat (limited to 'migrate/tests')
-rw-r--r-- | migrate/tests/fixture/database.py | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/migrate/tests/fixture/database.py b/migrate/tests/fixture/database.py index b0e3711..2a7a633 100644 --- a/migrate/tests/fixture/database.py +++ b/migrate/tests/fixture/database.py @@ -76,29 +76,40 @@ def usedb(supported=None, not_supported=None): @decorator def dec(f, self, *a, **kw): + failed_for = [] + exception = None for url in my_urls: - log.debug("Running test with engine %s", url) try: + log.debug("Running test with engine %s", url) try: - self._setup(url) - except Exception,e: - setup_exception=e - else: - setup_exception=None - f(self, *a, **kw) - finally: - try: - self._teardown() - except Exception,e: - teardown_exception=e - else: - teardown_exception=None - if setup_exception or teardown_exception: - raise RuntimeError(( - 'Exception during _setup/_teardown:\n' - 'setup: %r\n' - 'teardown: %r\n' - )%(setup_exception,teardown_exception)) + try: + self._setup(url) + except Exception,e: + setup_exception=e + else: + setup_exception=None + f(self, *a, **kw) + finally: + try: + self._teardown() + except Exception,e: + teardown_exception=e + else: + teardown_exception=None + if setup_exception or teardown_exception: + raise RuntimeError(( + 'Exception during _setup/_teardown:\n' + 'setup: %r\n' + 'teardown: %r\n' + )%(setup_exception,teardown_exception)) + except Exception,e: + failed_for.append(url) + exception = exception or e + for url in failed_for: + log.error('Failed for %s', url) + if exception: + # cause the failure :-) + raise exception return dec |