debugging using/and my plugin's logging

22 views
Skip to first unread message

Leah Klearman

unread,
May 15, 2013, 8:48:04 PM5/15/13
to nose-...@googlegroups.com
I'm trying to modify my nose-selenium plugin to take a screenshot on any error / failure. [1]

My implementation of addError / addFailure [2] doesn't seem to be working, but I'm having trouble troubleshooting it because its logging isn't coming through.

The logging seems to be a mess in and of itself. I included LogCapture in the list of available plugins for the test [3], but it appears to be capturing parent test case's logging [4] rather than the plugin's logging (used by the child but not by the parent) [5]. Some other messages I expect to be caught by the child test case's logging is floating upwards and is being output as if the parent testrunner has --nologcapture set (this logging is also coming out 17 times per test rather than once...eek!). [6]


Note: I am forcing the relevant test cases to fail so that I can inspect their output, because their logging is the best way for me to determine if they are Doing The Right Thing. I checked to see if self.capturedLogging was available like self.output was, but it looks like not. There doesn't appear to be any way to programmatically check the log output of the plugin.

Someone please rescue me from this morass!

By the way, is there an IRC channel where folks hang out?

Thanks!
-Leah

PS: I think I fixed the tests so that they will run in your environments, but I could be wrong, so I've attached output.
testresult.txt

Leah Klearman

unread,
May 19, 2013, 7:52:19 PM5/19/13
to nose-...@googlegroups.com
Since my last message, I've stopped trying to log the things and started trying to output them via formatError(), but it's still not showing up in self.output of the PluginTester derived class. I get the distinct impression that PluginTester is making my life difficult. The tests for log capture (which I based my solution on) are very unit-test-y and just tests that the log message appears in the plugin's handler.buffer, but doesn't test the formatting done by formatError()...

-Leah
Reply all
Reply to author
Forward
0 new messages