[PATCH] Change warning to exception in testcase.py
From: B. W. Fitzpatrick <fitz_at_red-bean.com>
Date: 2003-09-11 00:00:24 CEST
I'm sending this here for review before applying because I know it's a
After applying this patch (or a variant of it), we can officially close
-Fitz
-- Brian W. Fitzpatrick <fitz_at_red-bean.com> http://www.red-bean.com/fitz/ Log message: [[[ Change the existing warning about a status code * subversion/tests/clients/cmdline/svntest/testcase.py : Change warning into fatal exception. SVNTestStatusCodeError: New class. run(): Change warning to raise, catch, complain, and exit. ]]] Index: svntest/testcase.py =================================================================== --- svntest/testcase.py (revision 7042) +++ svntest/testcase.py (working copy) @@ -23,6 +23,12 @@ __all__ = ['TestCase', 'XFail', 'Skip'] + +class SVNTestStatusCodeError(Exception): + 'Test driver returned a status code.' + pass + + class _Predicate: """A general-purpose predicate that encapsulates a test case (function), a condition for its execution and a set of display properties for test @@ -92,13 +98,15 @@ print self.pred.skip_text(), else: try: - # FIXME: Remove this return code check after all tests - # have # been converted to throw exceptions instead of - # returning error codes. rc = apply(self.pred.func, args) if rc is not None: error = rc - print 'WARNING: Test driver returned a status code' + raise SVNTestStatusCodeError + except SVNTestStatusCodeError, ex: + print "STYLE ERROR in", + self._print_name() + print ex.__doc__ + sys.exit(255) except svntest.Failure, ex: error = 1 # We captured Failure and its subclasses. We don't want to print --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org For additional commands, e-mail: dev-help@subversion.tigris.orgReceived on Thu Sep 11 00:01:12 2003 |
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.