summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmlayton <dmlayton@gmail.com>2014-02-13 16:26:54 +0000
committerdmlayton <dmlayton@gmail.com>2014-02-13 16:26:54 +0000
commit2c610051fdcae58e5906ad9aa77b478e0f0951a0 (patch)
tree435b4815cab85a1cd8dfa92d94a29aa15c5ea6ca
parent2cdfd08afa804cf1ee60fc6c9c671547c77860b1 (diff)
downloadwebtest-2c610051fdcae58e5906ad9aa77b478e0f0951a0.tar.gz
make wrapping the app in the lint middleware optional
-rw-r--r--webtest/app.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/webtest/app.py b/webtest/app.py
index e58ba46..1ec627a 100644
--- a/webtest/app.py
+++ b/webtest/app.py
@@ -115,7 +115,7 @@ class TestApp(object):
RequestClass = TestRequest
def __init__(self, app, extra_environ=None, relative_to=None,
- use_unicode=True, cookiejar=None, parser_features=None):
+ use_unicode=True, cookiejar=None, parser_features=None, lint=True):
if 'WEBTEST_TARGET_URL' in os.environ:
app = os.environ['WEBTEST_TARGET_URL']
if isinstance(app, string_types):
@@ -131,6 +131,7 @@ class TestApp(object):
# __file__
app = loadapp(app, relative_to=relative_to)
self.app = app
+ self.lint = lint
self.relative_to = relative_to
if extra_environ is None:
extra_environ = {}
@@ -489,7 +490,7 @@ class TestApp(object):
self.cookiejar.add_cookie_header(utils._RequestCookieAdapter(req))
# verify wsgi compatibility
- app = lint.middleware(self.app)
+ app = lint.middleware(self.app) if self.lint else self.app
## FIXME: should it be an option to not catch exc_info?
res = req.get_response(app, catch_exc_info=True)