Chris McDonough
2011-09-24 fb2e07d9ae44bb4e5450d4ed46e476959b67cd41
Merge https://github.com/nmclean/pyramid into nmclean-master
2 files modified
12 ■■■■ changed files
pyramid/config/views.py 5 ●●●●● patch | view | raw | blame | history
pyramid/tests/test_config/test_views.py 7 ●●●●● patch | view | raw | blame | history
pyramid/config/views.py
@@ -416,7 +416,7 @@
def requestonly(view, attr=None):
    if attr is None:
        attr = '__call__'
    if inspect.isfunction(view):
    if inspect.isroutine(view):
        fn = view
    elif inspect.isclass(view):
        try:
@@ -436,8 +436,7 @@
    args = argspec[0]
    if hasattr(fn, 'im_func'):
        # it's an instance method
    if inspect.ismethod(fn):
        if not args:
            return False
        args = args[1:]
pyramid/tests/test_config/test_views.py
@@ -1763,6 +1763,13 @@
        class Foo: pass
        foo = Foo()
        self.assertFalse(self._callFUT(foo))
    def test_method_onearg_named_request(self):
        class Foo:
            def method(self, request):
                """ """
        foo = Foo()
        self.assertTrue(self._callFUT(foo.method))
class Test_isexception(unittest.TestCase):
    def _callFUT(self, ob):