6 messages in com.googlegroups.pylons-discussRe: paste eating exceptions in test s...
FromSent OnAttachments
Jamie Wilkinson26 Jul 2006 21:54 
Ben Bangert26 Jul 2006 22:58 
Jamie Wilkinson26 Jul 2006 23:10 
Ian Bicking27 Jul 2006 09:08 
Ben Bangert27 Jul 2006 09:55 
Jamie Wilkinson27 Jul 2006 19:12 
Subject:Re: paste eating exceptions in test suite that would otherwise be shown in debugger
From:Ben Bangert (be@groovie.org)
Date:07/26/2006 10:58:53 PM
List:com.googlegroups.pylons-discuss

On Jul 26, 2006, at 9:55 PM, Jamie Wilkinson wrote:

Within paste.fixture, when this happens, you don't get a useful traceback, you get a traceback from wsgilib throwing an AssertionError: No Errors should be written, because it caught an AssertionError: no errors should be written (ironic?).. because it caught "Debug at: http://localhost/_debug/view/...".

So what I really want is to see the real traceback in the test suite runner that I'd be seeing in the browser.

Has anyone found a good workaround to this?

If not, does anyone know where the best place to start tracing this back so I can patch paste to re-raise the correct exception?

which leads me to ask.. Why does paste even worry that an error was written? (Maybe that's a better question for the paste list?)

Yes, even if the traceback isn't shown, it will still toss a 500 giving you the same issue. paste.fixture assumes you want a 200 response, anything else and it blows. If you are expecting a 500 response, telling it you expect this will make it not throw an exception there (according to the docs). So I believe you'd want to do the request like so: resp = app.get('/something', status=500)

Which will then work (though I haven't tested this personally....). Docs here: http://pythonpaste.org/testing-applications.html#the-tests-themselves

Let me know how that works out.

HTH, Ben