From 7f1174bc5aafff4050ba0863629401c7641588b2 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Tue, 23 Feb 2016 00:07:04 -0600 Subject: add methods to DummyRequest --- pyramid/testing.py | 2 ++ pyramid/view.py | 9 --------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/pyramid/testing.py b/pyramid/testing.py index 14432b01f..3cb5d17b9 100644 --- a/pyramid/testing.py +++ b/pyramid/testing.py @@ -41,6 +41,7 @@ from pyramid.i18n import LocalizerRequestMixin from pyramid.request import CallbackMethodsMixin from pyramid.url import URLMethodsMixin from pyramid.util import InstancePropertyMixin +from pyramid.view import ViewMethodsMixin _marker = object() @@ -293,6 +294,7 @@ class DummyRequest( LocalizerRequestMixin, AuthenticationAPIMixin, AuthorizationAPIMixin, + ViewMethodsMixin, ): """ A DummyRequest object (incompletely) imitates a :term:`request` object. diff --git a/pyramid/view.py b/pyramid/view.py index 2966b0a50..822fb29d6 100644 --- a/pyramid/view.py +++ b/pyramid/view.py @@ -602,15 +602,6 @@ class ViewMethodsMixin(object): context_iface = providedBy(exc_info[0]) view_name = attrs.get('view_name', '') - # WARNING: do not assign the result of sys.exc_info() to a local - # var here, doing so will cause a leak. We used to actually - # explicitly delete both "exception" and "exc_info" from ``attrs`` - # in a ``finally:`` clause below, but now we do not because these - # attributes are useful to upstream tweens. This actually still - # apparently causes a reference cycle, but it is broken - # successfully by the garbage collector (see - # https://github.com/Pylons/pyramid/issues/1223). - # clear old generated request.response, if any; it may # have been mutated by the view, and its state is not # sane (e.g. caching headers) -- cgit v1.2.3