diff options
author | Julien Danjou <julien@danjou.info> | 2015-02-09 12:09:08 +0100 |
---|---|---|
committer | Ryan Petrello <lists@ryanpetrello.com> | 2015-03-02 12:29:37 -0500 |
commit | f4d923dca610da1ee208f403afdb63b1e69f0657 (patch) | |
tree | ee87ef8ce010c7aa3468fac658b157124d74e354 | |
parent | ff88de0f8c4579d29f8fe9fe2bde3ab48a763288 (diff) | |
download | pecan-f4d923dca610da1ee208f403afdb63b1e69f0657.tar.gz |
Fix broken wsme-stable job and pep8 failures.
Change-Id: I4ff0a7a7926f7a645fa8d59242be9d31bd683106
-rw-r--r-- | pecan/core.py | 8 | ||||
-rw-r--r-- | pecan/routing.py | 4 | ||||
-rw-r--r-- | pecan/secure.py | 10 | ||||
-rw-r--r-- | pecan/tests/scaffold_builder.py | 9 | ||||
-rw-r--r-- | pecan/tests/test_base.py | 9 | ||||
-rw-r--r-- | pecan/tests/test_secure.py | 10 | ||||
-rw-r--r-- | tox.ini | 5 |
7 files changed, 26 insertions, 29 deletions
diff --git a/pecan/core.py b/pecan/core.py index 414f164..1c1da68 100644 --- a/pecan/core.py +++ b/pecan/core.py @@ -11,10 +11,6 @@ import operator import types import six -if six.PY3: - from .compat import is_bound_method as ismethod -else: - from inspect import ismethod from webob import (Request as WebObRequest, Response as WebObResponse, exc, acceptparse) @@ -27,6 +23,10 @@ from .routing import lookup_controller, NonCanonicalPath from .util import _cfg, encode_if_needed, getargspec from .middleware.recursive import ForwardRequestException +if six.PY3: + from .compat import is_bound_method as ismethod +else: + from inspect import ismethod # make sure that json is defined in mimetypes add_type('application/json', '.json', True) diff --git a/pecan/routing.py b/pecan/routing.py index 58a74c6..1ac825f 100644 --- a/pecan/routing.py +++ b/pecan/routing.py @@ -64,8 +64,8 @@ def lookup_controller(obj, remainder, request=None): # If no arguments are passed to the _lookup, yet the # argspec requires at least one, raise a 404 if ( - remainder == [''] - and len(obj._pecan['argspec'].args) > 1 + remainder == [''] and + len(obj._pecan['argspec'].args) > 1 ): raise exc.HTTPNotFound obj_, remainder_ = result diff --git a/pecan/secure.py b/pecan/secure.py index cca81f0..ea9fd51 100644 --- a/pecan/secure.py +++ b/pecan/secure.py @@ -4,16 +4,16 @@ from webob import exc import six -if six.PY3: - from .compat import is_bound_method as ismethod -else: - from inspect import ismethod - from .decorators import expose from .util import _cfg, iscontroller __all__ = ['unlocked', 'secure', 'SecureController'] +if six.PY3: + from .compat import is_bound_method as ismethod +else: + from inspect import ismethod + class _SecureState(object): def __init__(self, desc, boolean_value): diff --git a/pecan/tests/scaffold_builder.py b/pecan/tests/scaffold_builder.py index 2c403ae..dc039da 100644 --- a/pecan/tests/scaffold_builder.py +++ b/pecan/tests/scaffold_builder.py @@ -3,17 +3,16 @@ import sys import subprocess import time +from six import b as b_ + +from pecan.compat import urlopen, URLError +from pecan.tests import PecanTestCase if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest # noqa -from six import b as b_ - -from pecan.compat import urlopen, URLError -from pecan.tests import PecanTestCase - if __name__ == '__main__': diff --git a/pecan/tests/test_base.py b/pecan/tests/test_base.py index 1369837..6cc0f3c 100644 --- a/pecan/tests/test_base.py +++ b/pecan/tests/test_base.py @@ -2,10 +2,6 @@ import sys import os import json import warnings -if sys.version_info < (2, 7): - import unittest2 as unittest # pragma: nocover -else: - import unittest # pragma: nocover import webob from webob.exc import HTTPNotFound @@ -25,6 +21,11 @@ from pecan.templating import ( from pecan.decorators import accept_noncanonical from pecan.tests import PecanTestCase +if sys.version_info < (2, 7): + import unittest2 as unittest # pragma: nocover +else: + import unittest # pragma: nocover + class SampleRootController(object): pass diff --git a/pecan/tests/test_secure.py b/pecan/tests/test_secure.py index 0f16a98..1d30ea3 100644 --- a/pecan/tests/test_secure.py +++ b/pecan/tests/test_secure.py @@ -1,10 +1,5 @@ import sys -if sys.version_info < (2, 7): - import unittest2 as unittest -else: - import unittest # noqa - from six import b as b_ from webtest import TestApp @@ -12,6 +7,11 @@ from pecan import expose, make_app from pecan.secure import secure, unlocked, SecureController from pecan.tests import PecanTestCase +if sys.version_info < (2, 7): + import unittest2 as unittest +else: + import unittest # noqa + try: set() except: @@ -114,10 +114,7 @@ commands=pecan create testing123 rest-api [testenv:wsme-stable] basepython = python2.7 deps = nose - wsme -# Manually download the source from PyPI with the --download flag. -# This gives us the ability to run the wsmeext (pecan) tests. -commands = pip install --download {envdir} --no-deps --no-clean --no-use-wheel wsme +commands = pip install --build {envdir}/build --pre --no-clean --no-use-wheel wsme nosetests -v {envdir}/build/wsme/tests/pecantest [testenv:wsme-tip] |