diff options
author | John Szakmeister <john@szakmeister.net> | 2013-08-11 02:36:50 -0700 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2013-08-11 02:36:50 -0700 |
commit | 7ce321f8cd98318edb889f1dc8ce7e3ab9a8c8a2 (patch) | |
tree | 371637d9a5fddb78976d0803202744bfc5d1b403 | |
parent | 8b2e522a1cf118c5e2ecf8f952564085c6c01028 (diff) | |
parent | c218ab255986606e417d146c52ae96bd1128690d (diff) | |
download | nose-7ce321f8cd98318edb889f1dc8ce7e3ab9a8c8a2.tar.gz |
Merge pull request #722 from djs/master
Don't save zero-byte xunit test reports
-rw-r--r-- | nose/plugins/xunit.py | 5 |
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']) |