Author elopio
Recipients elopio
Date 2012-12-20.16:16:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1356020181.84.0.076442170736.issue16739@psf.upfronthosting.co.za>
In-reply-to
Content
Using the unittest's texttestresult with stdout and verbosity 2 will fail because that stream doesn't have a writeln method.

  File "/usr/lib/python2.7/unittest/suite.py", line 108, in run
    test(result)
  File "/usr/lib/python2.7/unittest/suite.py", line 70, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/suite.py", line 108, in run
    test(result)
  File "/usr/lib/python2.7/unittest/suite.py", line 70, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/suite.py", line 108, in run
    test(result)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 398, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 375, in run
    result.addSuccess(self)
  File "/home/elopio/canonical/ubuntuone/photos-acceptance-2/lib/testtools/testresult/real.py", line 253, in addSuccess
    return self._dispatch('addSuccess', test, details=details)
  File "/home/elopio/canonical/ubuntuone/photos-acceptance-2/lib/testtools/testresult/real.py", line 231, in _dispatch
    for result in self._results)
  File "/home/elopio/canonical/ubuntuone/photos-acceptance-2/lib/testtools/testresult/real.py", line 231, in <genexpr>
    for result in self._results)
  File "/home/elopio/canonical/ubuntuone/photos-acceptance-2/lib/testtools/testresult/real.py", line 555, in addSuccess
    return self.decorated.addSuccess(test)
  File "/usr/lib/python2.7/unittest/runner.py", line 60, in addSuccess
    self.stream.writeln("ok")
AttributeError: 'file' object has no attribute 'writeln'

It would be nice if the stream is decorated with _WritelnDecorator, as it is done on TextTestRunner.
History
Date User Action Args
2012-12-20 16:16:21elopiosetrecipients: + elopio
2012-12-20 16:16:21elopiosetmessageid: <1356020181.84.0.076442170736.issue16739@psf.upfronthosting.co.za>
2012-12-20 16:16:21elopiolinkissue16739 messages
2012-12-20 16:16:21elopiocreate