def test_error_view(patch, pyramid_request): handle_exception = patch("h.views.errors.handle_exception") exception = Mock() result = error(exception, pyramid_request) handle_exception.assert_called_once_with(pyramid_request, exception) assert result == {}