I *temporarily* solved this by modifying an existing tween.  The relevant 
code looks like this:

    def my__tween(request):
        _redirect = None
        try:
            response = handler(request)
        except HTTPException as exc:
            _redirect = exc
        if _redirect:
            return _redirect
        return response

I'll likely migrate this to it's own tween for dev testing, unless I can 
figure out if the toolbar is loaded and run the code conditionally.  In any 
event, this approach lets me run my full test suite with the toolbar 
enabled.


On Friday, May 21, 2021 at 3:55:34 PM UTC-4 Jonathan Vanasco wrote:

> One of my CI tests deals with an edge case, in which a 
> HTTPMovedPermanently is raised in deeply nested code. This almost never 
> gets raised in Production - rules on the loadbalancer/gateway typically 
> catch it.
>
> With the debugtoolbar off, Pyramid serves the redirect.  With the 
> debugtoolbar enabled, it's caught by toolbar.py as an Exception and never 
> makes it to the block of code dealing with `intercept_redirects`.
>
> Has anyone encountered this before and developed a good workaround?  I 
> feel like this test used to pass, but I can't find anything on our change 
> history or Pyramid/Debugtoolbar's that would cause this change.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/9e810b38-4c1e-45a5-9ad4-b5d9f8983d77n%40googlegroups.com.

Reply via email to