Fix writing to the incorrect stream#171
Fix writing to the incorrect stream#171thedrow merged 3 commits intonose-devs:masterfrom CleanCut:horiz-rule-fix
Conversation
…s from controlling output.
…lly gets defined.
|
Your Travis CI setup is nice, btw. Especially since I can't figure out how to run the self-tests locally. |
|
I discovered that it was actually much more straightforward (and less buggy) to just take the example TextTestRunner and TextTestResult from unittest and write new versions than to try to adapt to nose's or nose2's plugin API and behavior. So Green is now a standalone test runner. I don't have any interest in finishing up the work required to get this pull request merged. If someone here wants the work so far, feel free to grab it before I delete my fork of nose2 in a few weeks. Green is runnable now. It doesn't aspire to have all the features that nose or nose2 have, but it's working pretty well for me. If anyone wants to check it out I would welcome feedback. |
In several places, the documentation makes it clear that plugins should be able to control the output via one means or another. In some cases, setting event.handled = True prevents default output. Those cases seem to be working fine.
In other cases, you are told to wrap (or otherwise modify) the stream attached to the event to control output. This mostly works, but I found three places in nose2 that were not writing to the correct stream (they were using the default stream instead of the stream on the event), which prevents a plugin from fully controlling the output.
This pull request simply fixes three
writelncalls to get called on the event's stream, just as the rest of the function is already doing in each case.In
_reportSummary()I also moved the location of thewritelncall down until after the event's stream had been set up.This is important for my particular plugin, because the whole point of the plugin is to completely change the output.