tornado.testing.LogTrapTestCase doesn't work with nose.plugin.logcapture #674

Closed
clarkorz opened this Issue Feb 4, 2013 · 1 comment

Projects

None yet

2 participants

@clarkorz
clarkorz commented Feb 4, 2013

if the TastCase inherits tornado.testing.LogTrapTestCase and runing under nose, test will fail because:
File "/Developer/python/beginner_env/lib/python2.7/site-packages/tornado/testing.py", line 355, in run
assert isinstance(handler, logging.StreamHandler)
AssertionError

According to tornado document, "This class assumes that only one log handler is configured and that it is a StreamHandler. This is true for both logging.basicConfig and the “pretty logging” configured by tornado.options."

I think they have familiar effect, using each one is ok. So it's a conflict. Fix it or document it:)

@bdarnell
Member
bdarnell commented Feb 6, 2013

Why are you using LogTrapTestCase if you're using a test runner that makes it redundant? Do you have a suggestion for how to make the documentation more clear? Most test runners have a similar feature, so I don't think it makes sense to list every one of them in the docs.

@bdarnell bdarnell added a commit that closed this issue Feb 9, 2013
@bdarnell bdarnell Make LogTrapTestCase fail more gracefully in unknown logging configur…
…ations.

This allows LogTrapTestCases to be run under nose, which does its own
log buffering.

Closes #674
534c556
@bdarnell bdarnell closed this in 534c556 Feb 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment