# HG changeset patch # User cmlenz # Date 1123515723 0 # Node ID 381233a91db62a330be21c4cf8bafdc43d023857 # Parent b63ed684c29cd81f1ea459e42920273e2e91f774 Fix for the {{{unittest}}} command, which was raising an exception but swallowing the traceback. diff --git a/bitten/util/testrunner.py b/bitten/util/testrunner.py --- a/bitten/util/testrunner.py +++ b/bitten/util/testrunner.py @@ -53,10 +53,12 @@ sys.stdout, sys.stderr = self.buf_stdout, self.buf_stderr def stopTest(self, test): - _TextTestResult.stopTest(self, test) self.tests[-1][2] = time.time() - self.tests[-1][2] self.tests[-1][3] = self.buf_stdout.getvalue() self.tests[-1][4] = self.buf_stderr.getvalue() + sys.stdout, sys.stderr = self.orig_stdout, self.orig_stderr + + _TextTestResult.stopTest(self, test) class XMLTestRunner(TextTestRunner): diff --git a/bitten/util/xmlio.py b/bitten/util/xmlio.py --- a/bitten/util/xmlio.py +++ b/bitten/util/xmlio.py @@ -131,14 +131,14 @@ """ __slots__ = ['name', 'attr'] - def __init__(self, *args, **attr): + def __init__(self, name_, **attr): """Create an XML element using the specified tag name. The tag name must be supplied as the first positional argument. All keyword arguments following it are handled as attributes of the element. """ Fragment.__init__(self) - self.name = args[0] + self.name = name_ self.attr = dict([(name, value) for name, value in attr.items() if value is not None]) @@ -164,7 +164,7 @@ __slots__ = [] - def __init__(self, parent, name, **attr): + def __init__(self, parent_, name_, **attr): """Create an XML element using the specified tag name. The first positional argument is the instance of the parent element that @@ -172,8 +172,8 @@ the name of the tag. All keyword arguments are handled as attributes of the element. """ - Element.__init__(self, name, **attr) - parent.append(self) + Element.__init__(self, name_, **attr) + parent_.append(self) def parse(text):