nose icon indicating copy to clipboard operation
nose copied to clipboard

logcapture doesn't work with tornado.testing.LogTrapTestCase

Open clark0x opened this issue 12 years ago • 3 comments
trafficstars

if the TastCase inherits tornado.testing.LogTrapTestCase and runing under nose, test will fail because: File "/Developer/python/beginer_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'm not sure this an issue of nose or tornado.

clark0x avatar Feb 04 '13 15:02 clark0x

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

clark0x avatar Feb 04 '13 15:02 clark0x

Fix it or document it:)

Fix what? Nose is not broken. And the bad error message should be fixed in tornado.testing. If you want to avoid log capturing in nose, use --nologcapture. Or are you advocating that Nose should be using a StreamHandler in it's implementation? I think it would be misguided for us to start documenting every TestCase-based class that works or doesn't work in Nose.

jszakmeister avatar Feb 05 '13 10:02 jszakmeister

If anything this is (was?) an issue with the assert statement in tornado. Should be closed here.

7yl4r avatar Nov 14 '18 15:11 7yl4r