diff options
| author | Michael Merickel <michael@merickel.org> | 2016-02-23 00:07:04 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2016-02-23 00:07:04 -0600 |
| commit | 7f1174bc5aafff4050ba0863629401c7641588b2 (patch) | |
| tree | d2a63011a001fffb1e5730988c50de5021ee89aa | |
| parent | 19016b0e5ab6c66a4b5eea01ab7a53e34145fbe6 (diff) | |
| download | pyramid-7f1174bc5aafff4050ba0863629401c7641588b2.tar.gz pyramid-7f1174bc5aafff4050ba0863629401c7641588b2.tar.bz2 pyramid-7f1174bc5aafff4050ba0863629401c7641588b2.zip | |
add methods to DummyRequest
| -rw-r--r-- | pyramid/testing.py | 2 | ||||
| -rw-r--r-- | 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) |
