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

pytest >= 3.2.4 raises an exception when pytest.mark.xfail() is used as a fixture param #2942

santa01 opened this issue Nov 22, 2017 · 2 comments


Copy link

@santa01 santa01 commented Nov 22, 2017

I have a with a parametrized fixture in a test subdir (see a minimal example attached) with one of the params declared as pytest.mark.xfail(). This puppy worked with pytest == 3.2.3 but after the pytest update to 3.2.4 (3.2.5 also affected) I get:

/tmp/pytest-rtpproxy/lib/python2.7/site-packages/py/_path/ in visit
    for x in Visitor(fil, rec, ignore, bf, sort).gen(self):
/tmp/pytest-rtpproxy/lib/python2.7/site-packages/py/_path/ in gen
    if p.check(dir=1) and (rec is None or rec(p))])
/tmp/pytest-rtpproxy/lib/python2.7/site-packages/_pytest/ in _recurse
    ihook = self.gethookproxy(path)
/tmp/pytest-rtpproxy/lib/python2.7/site-packages/_pytest/ in gethookproxy
    my_conftestmodules = pm._getconftestmodules(fspath)
/tmp/pytest-rtpproxy/lib/python2.7/site-packages/_pytest/ in _getconftestmodules
    mod = self._importconftest(conftestpath)
/tmp/pytest-rtpproxy/lib/python2.7/site-packages/_pytest/ in _importconftest
    raise ConftestImportFailure(conftestpath, sys.exc_info())
E   ConftestImportFailure: ValueError('need more than 1 value to unpack',)
E     File "/tmp/pytest-rtpproxy/lib/python2.7/site-packages/_pytest/assertion/", line 212, in load_module
E       py.builtin.exec_(co, mod.__dict__)
E     File "/tmp/pytest-rtpproxy/lib/python2.7/site-packages/py/", line 221, in exec_
E       exec2(obj, globals, locals)
E     File "<string>", line 7, in exec2
E     File "/home/porta-one/repos/rtpproxy/test/ft/ft1_dummy/", line 3, in <module>
E       @pytest.fixture(params = ['OK', pytest.mark.xfail('FAIL')])
E     File "/tmp/pytest-rtpproxy/lib/python2.7/site-packages/_pytest/", line 264, in __getattr__
E       self._check(name)
E     File "/tmp/pytest-rtpproxy/lib/python2.7/site-packages/_pytest/", line 275, in _check
E       marker, _ = line.split(":", 1)

Please note that no exception is raised if I move to the test root dir.

To setup the virtualenv and start the tests I do:

> virtualenv --system-site-packages /tmp/somewhere
/tmp/somewhere/bin/pip install pytest pytest-xdist pytest-timeout
/tmp/somewhere/bin/py.test -s

Minimal example attached:

Virtualenv package list attached: virtualenv.txt

The virtualenv is deployed with:

> /usr/bin/python 
Python 2.7.5 (default, May 29 2017, 20:42:36) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2

> yum info python
Version     : 2.7.5
Release     : 58.0.1.el7

> yum info python-virtualenv
Version     : 1.10.1
Release     : 4.el7

OS: Red Hat Enterprise Linux Server release 7.4 (Maipo)

edit by @nicoddemus: formatting

Copy link

@nicoddemus nicoddemus commented Nov 22, 2017

Thanks @santa01 for the report!

I think this was introduced by #2856 and #2867. Perhaps @Perlence would like to take a look?

Copy link

@Perlence Perlence commented Nov 22, 2017

@nicoddemus Sure, let me see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.