diff options
| author | Chris McDonough <chrism@plope.com> | 2011-09-26 05:20:48 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-09-26 05:20:48 -0400 |
| commit | 9f7de68bc84af8343949b9dd98e53dc9ca8b77a1 (patch) | |
| tree | 5afde1d379c6e7f7509d212e0f1e5de3103bb272 | |
| parent | 632a912b4b7f6f387adee2ebadebd677f2ebc82c (diff) | |
| download | pyramid-9f7de68bc84af8343949b9dd98e53dc9ca8b77a1.tar.gz pyramid-9f7de68bc84af8343949b9dd98e53dc9ca8b77a1.tar.bz2 pyramid-9f7de68bc84af8343949b9dd98e53dc9ca8b77a1.zip | |
get rid of resourcewarnings
| -rw-r--r-- | pyramid/renderers.py | 1 | ||||
| -rw-r--r-- | pyramid/tests/test_config/test_views.py | 1 | ||||
| -rw-r--r-- | pyramid/tests/test_static.py | 14 |
3 files changed, 11 insertions, 5 deletions
diff --git a/pyramid/renderers.py b/pyramid/renderers.py index 88cb869a5..073ce444d 100644 --- a/pyramid/renderers.py +++ b/pyramid/renderers.py @@ -17,7 +17,6 @@ from pyramid.asset import asset_spec_from_abspath from pyramid.compat import json from pyramid.compat import string_types from pyramid.compat import text_type -from pyramid.compat import native_ from pyramid.decorator import reify from pyramid.events import BeforeRender from pyramid.path import caller_package diff --git a/pyramid/tests/test_config/test_views.py b/pyramid/tests/test_config/test_views.py index 1f7ea05c2..0813eecdb 100644 --- a/pyramid/tests/test_config/test_views.py +++ b/pyramid/tests/test_config/test_views.py @@ -1429,6 +1429,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): request.subpath = ('minimal.pt', ) result = wrapped(None, request) self.assertEqual(result.status, '200 OK') + self.assertTrue(result.body.startswith(b'<div')) def test_add_static_view_package_relative(self): from pyramid.interfaces import IStaticURLInfo diff --git a/pyramid/tests/test_static.py b/pyramid/tests/test_static.py index 427b03c80..9fdf29637 100644 --- a/pyramid/tests/test_static.py +++ b/pyramid/tests/test_static.py @@ -143,8 +143,11 @@ class Test_static_view_use_subpath_False(unittest.TestCase): response = inst(context, request) start_response = DummyStartResponse() app_iter = response(request.environ, start_response) - self.assertEqual(start_response.status, '304 Not Modified') - self.assertEqual(list(app_iter), []) + try: + self.assertEqual(start_response.status, '304 Not Modified') + self.assertEqual(list(app_iter), []) + finally: + app_iter.close() def test_not_found(self): inst = self._makeOne('pyramid.tests:fixtures/static') @@ -306,8 +309,11 @@ class Test_static_view_use_subpath_True(unittest.TestCase): response = inst(context, request) start_response = DummyStartResponse() app_iter = response(request.environ, start_response) - self.assertEqual(start_response.status, '304 Not Modified') - self.assertEqual(list(app_iter), []) + try: + self.assertEqual(start_response.status, '304 Not Modified') + self.assertEqual(list(app_iter), []) + finally: + app_iter.close() def test_not_found(self): inst = self._makeOne('pyramid.tests:fixtures/static') |
