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 --fixtures-per-test -> 'DoctestItem' object has no attribute '_fixtureinfo' #2788

obestwalter opened this issue Sep 18, 2017 · 2 comments


Copy link

@obestwalter obestwalter commented Sep 18, 2017

Hi, I just stumbled over this behaviour when calling 'pytest --fixtures-per-test' in the pytest repo with a fresh venv on 3.6:

pytest --fixtures-per-test

-------------------------------------------------------- fixtures used by test_source_of_class_at_eof_without_newline --------------------------------------------------------
--------------------------------------------------------------------- (testing/code/ ----------------------------------------------------------------------
    Return a temporary directory path object
    which is unique to each test function invocation,
    created as a sub directory of the base temporary
    directory.  The returned object is a `py.path.local`_
    path object.
    Return a TempdirFactory instance for the test session.
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/oliver/.virtualenvs/tmp/lib/python3.6/site-packages/_pytest/", line 110, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/oliver/.virtualenvs/tmp/lib/python3.6/site-packages/_pytest/", line 1025, in _show_fixtures_per_test
INTERNALERROR>     write_item(item)
INTERNALERROR>   File "/home/oliver/.virtualenvs/tmp/lib/python3.6/site-packages/_pytest/", line 1006, in write_item
INTERNALERROR>     name2fixturedefs = item._fixtureinfo.name2fixturedefs
INTERNALERROR> AttributeError: 'DoctestItem' object has no attribute '_fixtureinfo'

python --version

Python 3.6.2

$ uname -av

Linux ob1 4.12.13-1-ARCH #1 SMP PREEMPT Fri Sep 15 06:36:43 UTC 2017 x86_64 GNU/Linux


Package    Version
---------- -------
pip        9.0.1  
py         1.4.34 
pytest     3.2.2  
setuptools 36.5.0 
wheel      0.30.0 

pytest --version

This is pytest version 3.2.2, imported from /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/
setuptools registered plugins:
  pytest-xdist-1.20.0 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/xdist/
  pytest-xdist-1.20.0 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/xdist/
  pytest-timeout-1.2.0 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/
  pytest-forked-0.2 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/pytest_forked/
  pytest-cov-2.5.1 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/pytest_cov/
Copy link
Member Author

@obestwalter obestwalter commented Sep 18, 2017

It's reproducible with pytest 3.2.2 and develop install from master.

Copy link

@nicoddemus nicoddemus commented Sep 18, 2017

Thanks @obestwalter!

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.

2 participants