summaryrefslogtreecommitdiff
path: root/nose/result.py
diff options
context:
space:
mode:
authorJason Pellerin <jpellerin@gmail.com>2007-04-08 02:25:15 +0000
committerJason Pellerin <jpellerin@gmail.com>2007-04-08 02:25:15 +0000
commitde657483c7540ba152e6aeed68d1b4bc4427d529 (patch)
tree4ad6c9028688b552ebc30da4960348db4fd09aae /nose/result.py
parentfaceb8ce13791ee700cb35e2c4acf24dc7acbae0 (diff)
downloadnose-de657483c7540ba152e6aeed68d1b4bc4427d529.tar.gz
Fixed loader and result bugs.
Diffstat (limited to 'nose/result.py')
-rw-r--r--nose/result.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/nose/result.py b/nose/result.py
index d4840e1..6d586b3 100644
--- a/nose/result.py
+++ b/nose/result.py
@@ -32,12 +32,12 @@ class TextTestResult(_TextTestResult):
errorClasses. If the exception is a registered class, the
error will be added to the list for that class, not errors.
"""
+ stream = getattr(self, 'stream', None)
ec, ev, tb = err
for cls, (storage, label, isfail) in self.errorClasses.items():
if issubclass(ec, cls):
storage.append((test, self._exc_info_to_string(err, test)))
# Might get patched into a streamless result
- stream = getattr(self, 'stream', None)
if stream is not None:
if self.showAll:
stream.writeln(label)
@@ -45,10 +45,11 @@ class TextTestResult(_TextTestResult):
stream.write(label[:1])
return
self.errors.append((test, self._exc_info_to_string(err, test)))
- if self.showAll:
- self.stream.writeln('ERROR')
- elif self.dots:
- stream.write('E')
+ if stream is not None:
+ if self.showAll:
+ self.stream.writeln('ERROR')
+ elif self.dots:
+ stream.write('E')
def printErrors(self):
"""Overrides to print all errorClasses errors as well.