Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixture named "request" fails #794

Closed
spaceone opened this issue Jun 21, 2015 · 1 comment
Closed

fixture named "request" fails #794

spaceone opened this issue Jun 21, 2015 · 1 comment

Comments

@spaceone
Copy link
Contributor

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


@spaceone
Copy link
Contributor Author

duplicate of #611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant