Repository navigation
fixture named "request" fails #794
Copy link
Copy link
Closed
Description
I created a fixture named "request". Normal tests works with it. If i add mark.parametrize i get the following exception:
/usr/lib/python2.7/site-packages/_pytest/runner.py:149:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ $
/usr/lib/python2.7/site-packages/_pytest/runner.py:137: in <lambda>
return CallInfo(lambda: ihook(item=item, **kwds), when=when)
/usr/lib/python2.7/site-packages/_pytest/core.py:521: in __call__
return self._docall(self.methods, kwargs)
/usr/lib/python2.7/site-packages/_pytest/core.py:528: in _docall
firstresult=self.firstresult).execute()
/usr/lib/python2.7/site-packages/_pytest/core.py:393: in execute
return wrapped_call(method(*args), self.execute)
/usr/lib/python2.7/site-packages/_pytest/core.py:113: in wrapped_call
return call_outcome.get_result()
/usr/lib/python2.7/site-packages/_pytest/core.py:138: in get_result
py.builtin._reraise(*ex)
/usr/lib/python2.7/site-packages/_pytest/core.py:123: in __init__
self.result = func()
/usr/lib/python2.7/site-packages/_pytest/core.py:394: in execute
res = method(*args)
/usr/lib/python2.7/site-packages/_pytest/runner.py:86: in pytest_runtest_setup
item.session._setupstate.prepare(item)
/usr/lib/python2.7/site-packages/_pytest/runner.py:403: in prepare
col.setup()
/usr/lib/python2.7/site-packages/_pytest/python.py:1187: in setup
fillfixtures(self)
/usr/lib/python2.7/site-packages/_pytest/python.py:692: in fillfixtures
request._fillfixtures()
/usr/lib/python2.7/site-packages/_pytest/python.py:1335: in _fillfixtures
item.funcargs[argname] = self.getfuncargvalue(argname)
/usr/lib/python2.7/site-packages/_pytest/python.py:1378: in getfuncargvalue
return self._get_active_fixturedef(argname).cached_result[0]
/usr/lib/python2.7/site-packages/_pytest/python.py:1395: in _get_active_fixturedef
result = self._getfuncargvalue(fixturedef)
/usr/lib/python2.7/site-packages/_pytest/python.py:1441: in _getfuncargvalue
val = fixturedef.execute(request=subrequest)
/usr/lib/python2.7/site-packages/_pytest/python.py:1907: in execute
self.yieldctx)
/usr/lib/python2.7/site-packages/_pytest/python.py:1832: in call_fixture_func
res = fixturefunc(**kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ $
request = <HTTP Request(GET / HTTP/1.1)>
def get_direct_param_fixture_func(request):
> return request.param
E AttributeError: 'Request' object has no attribute 'param'
/usr/lib/python2.7/site-packages/_pytest/python.py:454: AttributeError
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
spaceone commentedon Jun 21, 2015
duplicate of #611