summaryrefslogtreecommitdiff
path: root/nose/plugins
diff options
context:
space:
mode:
authorDan Savilonis <djs@n-cube.org>2013-08-05 21:53:21 -0400
committerDan Savilonis <djs@n-cube.org>2013-08-05 21:53:21 -0400
commitc218ab255986606e417d146c52ae96bd1128690d (patch)
tree371637d9a5fddb78976d0803202744bfc5d1b403 /nose/plugins
parent8b2e522a1cf118c5e2ecf8f952564085c6c01028 (diff)
downloadnose-c218ab255986606e417d146c52ae96bd1128690d.tar.gz
Don't save zero-byte xunit test reports
Diffstat (limited to 'nose/plugins')
-rw-r--r--nose/plugins/xunit.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/nose/plugins/xunit.py b/nose/plugins/xunit.py
index 1533e57..88255b9 100644
--- a/nose/plugins/xunit.py
+++ b/nose/plugins/xunit.py
@@ -199,8 +199,7 @@ class Xunit(Plugin):
'skipped': 0
}
self.errorlist = []
- self.error_report_file = codecs.open(options.xunit_file, 'w',
- self.encoding, 'replace')
+ self.error_report_file_name = options.xunit_file
def report(self, stream):
"""Writes an Xunit-formatted XML file
@@ -208,6 +207,8 @@ class Xunit(Plugin):
The file includes a report of test errors and failures.
"""
+ self.error_report_file = codecs.open(self.error_report_file_name, 'w',
+ self.encoding, 'replace')
self.stats['encoding'] = self.encoding
self.stats['total'] = (self.stats['errors'] + self.stats['failures']
+ self.stats['passes'] + self.stats['skipped'])