Twisted: Ticket #2883: Remove attributes and methods from IReporter that imply text outputhttps://twistedmatrix.com/trac/ticket/2883
<p>
The following methods should be removed from <code>IReporter</code>:
</p>
<ul><li>write
</li><li>writeln
</li><li>printErrors
</li><li>printSummary
</li></ul><p>
The following attributes should also be removed:
</p>
<ul><li>stream
</li><li>separator
</li></ul><p>
We should also consider removing <code>tbformat</code>.
</p>
<p>
These should be replaced with a single method <code>done()</code>. This method can then be called by a test runner to tell the reporter that the entire test suite has finished running and that it can now summarize results.
</p>
<p>
Naturally, 'remove' means 'deprecate'.
</p>
en-usTwistedhttps://twistedmatrix.com/trac/chrome/common/trac_banner.pnghttps://twistedmatrix.com/trac/ticket/2883
Trac 1.2Jonathan LangeMon, 19 Nov 2007 02:11:03 GMTbranch, author sethttps://twistedmatrix.com/trac/ticket/2883#comment:1
https://twistedmatrix.com/trac/ticket/2883#comment:1
<ul>
<li><strong>branch</strong>
set to <em>branches/trial-reporter-done-2883</em>
</li>
<li><strong>author</strong>
set to <em>jml</em>
</li>
</ul>
<p>
(In <a class="missing changeset" title="No changeset 21849 in the repository">[21849]</a>) Branching to 'trial-reporter-done-2883'
</p>
TicketJonathan LangeMon, 19 Nov 2007 14:51:46 GMTpriority changed; keywords set; owner deletedhttps://twistedmatrix.com/trac/ticket/2883#comment:2
https://twistedmatrix.com/trac/ticket/2883#comment:2
<ul>
<li><strong>owner</strong>
<em>Jonathan Lange</em> deleted
</li>
<li><strong>priority</strong>
changed from <em>normal</em> to <em>highest</em>
</li>
<li><strong>keywords</strong>
<em>review</em> added
</li>
</ul>
<p>
Ready, I think.
</p>
TicketJean-Paul CalderoneTue, 20 Nov 2007 15:42:18 GMTstatus changed; owner sethttps://twistedmatrix.com/trac/ticket/2883#comment:3
https://twistedmatrix.com/trac/ticket/2883#comment:3
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>assigned</em>
</li>
<li><strong>owner</strong>
set to <em>Jean-Paul Calderone</em>
</li>
</ul>
TicketJean-Paul CalderoneTue, 20 Nov 2007 16:16:42 GMTowner, status changed; keywords deletedhttps://twistedmatrix.com/trac/ticket/2883#comment:4
https://twistedmatrix.com/trac/ticket/2883#comment:4
<ul>
<li><strong>keywords</strong>
<em>review</em> removed
</li>
<li><strong>owner</strong>
changed from <em>Jean-Paul Calderone</em> to <em>Jonathan Lange</em>
</li>
<li><strong>status</strong>
changed from <em>assigned</em> to <em>new</em>
</li>
</ul>
<ul><li>twisted/trial/itrial.py: Some docstrings use <strong>DEPRECATED</strong>, some use <strong>Deprecated</strong>. Should be easy to pick one or the other.
</li><li>twisted/trial/reporter.py
<ul><li>New/modified and undocumented and not deprecated on Reporter:
<ul><li>startTime
</li><li>startTest
</li><li>addFailure
</li><li>addError
</li><li>_write
</li><li>_writeln
</li><li>_printResults
</li><li>_printErrors
</li><li>_printSummary
</li></ul></li><li>done's docstring might be improved if it were just a little bit more specific (ie, it writes the summary to its stream and the summary includes the number of tests run and how long they took)
</li><li>MinimalReporter's _printErrors and _printSummary also changed but have no docstrings
</li><li>Lots of methods without docstrings changed on TextReporter
</li><li>Lots of methods without docstrings changed on VerboseTextReporter
</li><li>TimingTextReporter.stopTest has no docstring
</li><li>Changed methods on TreeReporter without docstrings
<ul><li>_testPrelude
</li><li>startTest
</li><li>endLine
</li></ul></li></ul></li><li>twisted/trial/runner.py
<ul><li>a warning in TrialRunner.run for the case where <code>done</code> is <code>None</code>, pointing out that the new method should be implemented, would be helpful (ideally this would refer to the location of the definition of the type of the result, but doing that right is probably tricky enough to merit another ticket)
</li></ul></li><li>twisted/trial/test/test_runner.py
<ul><li>Test methods changed without docstrings:
<ul><li>PyunitTestNames.test_minimalReporter
</li><li>SkipTest.test_summary
</li><li>SkipTest.test_basicErrors
</li><li>SkipTest.test_booleanSkip
</li><li>SkipTest.test_exceptionSkip
</li></ul></li><li>I think the new deprecation tests really want to be indirecting the call to the deprecated methods by one level (eg, <code>lambda: writeln()</code> instead of <code>writeln</code>) and dropping the stack level down to 2. A utility or more structured way to define deprecations here would certainly be an improvement over this trick and using __file__ with <code>assertWarns</code>.
</li></ul></li></ul>
TicketJonathan LangeTue, 20 Nov 2007 17:39:33 GMTowner changed; keywords sethttps://twistedmatrix.com/trac/ticket/2883#comment:5
https://twistedmatrix.com/trac/ticket/2883#comment:5
<ul>
<li><strong>keywords</strong>
<em>review</em> added
</li>
<li><strong>owner</strong>
changed from <em>Jonathan Lange</em> to <em>Jean-Paul Calderone</em>
</li>
</ul>
<ul><li>I've skipped docstrings for <code>VerboseTextReporter</code> and <code>TestReporter</code>. The methods are so similar, so short and so few that they are adequately covered by their class docstrings, interface docstrings and base-class method docstrings.
</li></ul><p>
Otherwise, everything is covered, I think.
</p>
TicketJean-Paul CalderoneTue, 20 Nov 2007 20:06:55 GMTowner changed; keywords deletedhttps://twistedmatrix.com/trac/ticket/2883#comment:6
https://twistedmatrix.com/trac/ticket/2883#comment:6
<ul>
<li><strong>keywords</strong>
<em>review</em> removed
</li>
<li><strong>owner</strong>
changed from <em>Jean-Paul Calderone</em> to <em>Jonathan Lange</em>
</li>
</ul>
<p>
done's docstring misspells <em>occurred</em> as <em>occured</em>.
</p>
<p>
There's no test for the warning emitted if <code>done</code> is <code>None</code>. Also the stacklevel is probably irrelevant, since there's probably no interesting user-code above the call on the stack.
</p>
<p>
The rest is good, merge once the above items are fixed.
</p>
TicketJonathan LangeTue, 20 Nov 2007 22:11:06 GMTstatus changed; resolution sethttps://twistedmatrix.com/trac/ticket/2883#comment:7
https://twistedmatrix.com/trac/ticket/2883#comment:7
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
Fixed in <a class="missing changeset" title="No changeset 21918 in the repository">[21918]</a>.
</p>
Ticket<automation>Mon, 14 Feb 2011 04:30:49 GMTowner deletedhttps://twistedmatrix.com/trac/ticket/2883#comment:8
https://twistedmatrix.com/trac/ticket/2883#comment:8
<ul>
<li><strong>owner</strong>
<em>Jonathan Lange</em> deleted
</li>
</ul>
Ticket