[TIP] pytest

Bruno Oliveira nicoddemus at gmail.com
Fri Oct 14 10:16:14 PDT 2016


After fixing the missing “pytest” import, I get this error:

foo.py:8: in <module>
E   AttributeError: 'Config' object has no attribute 'request'

Please make sure to post a complete example and state clearly what your
problem is and what you are trying to accomplish.


On Fri, Oct 14, 2016 at 2:03 PM James <bjlockie at lockie.ca> wrote:

> I have this in my config file:
> @pytest.fixture(scope='module')
> def A(request):
>     return request.config.getoption("--A")
> skip_A = pytest.mark.skipif(
>     A(pytest.config.request),
>     reason="need --A option to run"
> )
> but when I run it, it says
> E   NameError: name 'A' is not defined
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20161014/bf295fdc/attachment.htm>

More information about the testing-in-python mailing list