comparison MoinMoin/conftest.py @ 4952:2117e64aea4e

support py.test 1.0 funcargs (thanks to Holger Krekel for the patch)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 09 Aug 2009 01:30:45 +0200
parents 8a1c8fb7c689
children 043baa5879b3
comparison
equal deleted inserted replaced
4951:315b15e9cd5e 4952:2117e64aea4e
79 return request 79 return request
80 80
81 81
82 # py.test customization starts here 82 # py.test customization starts here
83 83
84 # py.test-1.0 provides "funcargs" natively
85 def pytest_funcarg__request(request):
86 # note the naminng clash: py.test's funcarg-request object
87 # and the request we provide are totally separate things
88 cls = request._pyfuncitem.getparent(py.test.collect.Module)
89 return cls.request
90
84 class MoinTestFunction(py.test.collect.Function): 91 class MoinTestFunction(py.test.collect.Function):
85 def execute(self, target, *args): 92 def execute(self, target, *args):
86 request = self.parent.request 93 request = self.parent.request
87 co = target.func_code 94 co = target.func_code
88 if 'request' in co.co_varnames[:co.co_argcount]: 95 if 'request' in co.co_varnames[:co.co_argcount]: