[Pyunit-interest] _WritelnDecorator.writeln()
Brought to you by:
purcell
From: Fred L. D. Jr. <fd...@ac...> - 2003-03-21 18:57:48
|
The _WritelnDecorator.writeln() method doesn't have a docstring, but appears to want to allow multiple values to be passed to be written to the output stream. Unfortunately, it doesn't actually accept more than one, since the underlying stream object's write() method can only take one. The result of passing more than one is a TypeError. Since the unittest implementation never passes more than one, and the signature of the current implementation is misleading, I'll suggest that it be modified to accept at most one argument: def writeln(self, s=''): self.write(s) self.write('\n') # text-mode streams translate to \r\n if needed This would avoid confusion for people attempting to extend the runner support that uses this method. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation |