<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt">Hi,<br><br>If i need to add an Environment variable (shell env variable) to xunit plugin for nosetests: like:<br><br> def addError(self, test, err, capt=None):<br> """Add error output to Xunit report.<br> """<br> taken = self._timeTaken()<br> db = os.getenv('DB_SYSTEM')<br><br> if issubclass(err[0], SkipTest):<br> type = 'skipped'<br> self.stats['skipped'] += 1<br> else:<br> type =
'error'<br> self.stats['errors'] += 1<br> tb = ''.join(traceback.format_exception(*err))<br> id = test.id()<br> self.errorlist.append(<br> '<testcase classname=%(cls)s name=%(name)s db="%(db)s" time="%(taken).3f">'<br> '<%(type)s type=%(errtype)s message=%(message)s><![CDATA[%(tb)s]]>'<br> '</%(type)s></testcase>' %<br> {'cls': self._quoteattr(id_split(id)[0]),<br> 'name':
self._quoteattr(id_split(id)[-1]),<br> 'db': db,<br> 'taken': taken,<br> 'type': type,<br> 'errtype': self._quoteattr(nice_classname(err[0])),<br> 'message': self._quoteattr(exc_message(err)),<br> 'tb': escape_cdata(tb),<br> })<br><br>or there is better way of doing this <br><br>Any suggestions are welcome<br><br>Thanks,<br>-Kamal.<br><br></div></body></html>