Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
zope.testbrowser's handleErrors and pyramid
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brian Sutherland  
View profile  
 More options May 24 2011, 12:48 pm
From: Brian Sutherland <br...@vanguardistas.net>
Date: Tue, 24 May 2011 18:48:03 +0200
Local: Tues, May 24 2011 12:48 pm
Subject: zope.testbrowser's handleErrors and pyramid
Hi,

I'm using zope.testbrowser to test a pyramid application I'm working on.
I'd really like to get the Browser.handleErrors knob working.

zope.testbrowser puts two variables into the WSGI envronment to try get
the application it's testing to throw rather than catch errors:

        if not handle_errors:
            # There doesn't seem to be a "Right Way" to do this
            extra_environ['wsgi.handleErrors'] = False # zope.app.wsgi does this
            extra_environ['paste.throw_errors'] = True # the paste way of doing this

Perhaps it's as simple as putting this in pyramid/router.py:

    if not environ.get('wsgi.handleErrors', True):
        raise

But I'm guessing not. Any advice before I start working up a patch?

--
Brian Sutherland


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gael Pasgrimaud  
View profile  
 More options May 24 2011, 12:55 pm
From: Gael Pasgrimaud <g...@gawel.org>
Date: Tue, 24 May 2011 18:55:34 +0200
Local: Tues, May 24 2011 12:55 pm
Subject: Re: zope.testbrowser's handleErrors and pyramid
Hi,

On Tue, May 24, 2011 at 6:48 PM, Brian Sutherland

<br...@vanguardistas.net> wrote:

> But I'm guessing not. Any advice before I start working up a patch?

Use WebTest ? Just a thought. Maybe you really want to use zope.testbrowser.

--
Gael


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Sutherland  
View profile  
 More options May 24 2011, 1:25 pm
From: Brian Sutherland <br...@vanguardistas.net>
Date: Tue, 24 May 2011 19:25:51 +0200
Local: Tues, May 24 2011 1:25 pm
Subject: Re: zope.testbrowser's handleErrors and pyramid

On Tue, May 24, 2011 at 06:55:34PM +0200, Gael Pasgrimaud wrote:
> Hi,

> On Tue, May 24, 2011 at 6:48 PM, Brian Sutherland
> <br...@vanguardistas.net> wrote:

> > But I'm guessing not. Any advice before I start working up a patch?

> Use WebTest ? Just a thought. Maybe you really want to use zope.testbrowser.

Same question really. How do I ask, with WebTest, for the error not to
be caught?

http://pythonpaste.org/webtest/#framework-hooks mentions "paste.throw_errors".

--
Brian Sutherland


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wichert Akkerman  
View profile  
 More options May 24 2011, 2:41 pm
From: Wichert Akkerman <wich...@wiggy.net>
Date: Tue, 24 May 2011 20:41:38 +0200
Local: Tues, May 24 2011 2:41 pm
Subject: Re: zope.testbrowser's handleErrors and pyramid
On 2011-5-24 18:48, Brian Sutherland wrote:

I'm not sure what you mean exactly, but have you tried setting
browser.raiseHttpErrors = False ?

Wichert.

--
Wichert Akkerman <wich...@wiggy.net>   It is simple to make things.
http://www.wiggy.net/                  It is hard to make things simple.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Sutherland  
View profile  
 More options May 25 2011, 5:00 am
From: Brian Sutherland <br...@vanguardistas.net>
Date: Wed, 25 May 2011 11:00:26 +0200
Local: Wed, May 25 2011 5:00 am
Subject: Re: zope.testbrowser's handleErrors and pyramid

raiseHttpErrors is slightly different from handleErrors and doesn't
require any help from the WSGI application under test:

    http://pypi.python.org/pypi/zope.testbrowser#handling-errors

I mostly use handleErrors to quickly debug test failures. i.e. when an
exception is raised inside a view but then converted to a nicely
formatted error page by a bare try/except.

In that case you want to quickly see the exception rather than the HTML
error page.

The specific bare try/except bothering me in this case is in
pyramid.router.Router.__call__.

--
Brian Sutherland


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »