diff options
Diffstat (limited to 'tests/test_exceptions/test_error_middleware.py')
-rw-r--r-- | tests/test_exceptions/test_error_middleware.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/test_exceptions/test_error_middleware.py b/tests/test_exceptions/test_error_middleware.py index a34de73..95ab177 100644 --- a/tests/test_exceptions/test_error_middleware.py +++ b/tests/test_exceptions/test_error_middleware.py @@ -19,7 +19,7 @@ def do_request(app, expect_status=500): def clear_middleware(app): """ The fixture sets paste.throw_errors, which suppresses exactly what - we want to test in this case. This wrapper also strips exc_info + we want to test in this case. This wrapper also strips exc_info on the *first* call to start_response (but not the second, or subsequent calls. """ @@ -34,7 +34,7 @@ def clear_middleware(app): del environ['paste.throw_errors'] return app(environ, replacement) return clear_throw_errors - + ############################################################ ## Applications that raise exceptions @@ -57,7 +57,7 @@ def after_start_response_app(environ, start_response): def iter_app(environ, start_response): start_response("200 OK", [('Content-type', 'text/plain')]) - return yielder(['this', ' is ', ' a', None]) + return yielder([b'this', b' is ', b' a', None]) def yielder(args): for arg in args: @@ -73,15 +73,17 @@ def test_makes_exception(): res = do_request(bad_app) assert '<html' in res res = strip_html(str(res)) - #print res - assert 'bad_app() takes no arguments (2 given' in res + if six.PY3: + assert 'bad_app() takes 0 positional arguments but 2 were given' in res + else: + assert 'bad_app() takes no arguments (2 given' in res, repr(res) assert 'iterator = application(environ, start_response_wrapper)' in res assert 'paste.lint' in res assert 'paste.exceptions.errormiddleware' in res def test_unicode_exception(): res = do_request(unicode_bad_app) - + def test_start_res(): res = do_request(start_response_app) @@ -101,7 +103,7 @@ def test_iter_app(): #print res assert 'None raises error' in res assert 'yielder' in res - - - + + + |