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

Closed
obestwalter opened this issue Sep 18, 2017 · 2 comments · Fixed by #2789
Closed
Labels
topic: reporting related to terminal output and user-facing messages and errors type: bug problem that needs to be addressed

Comments

@obestwalter
Copy link
Member

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/test_source.py:395) ----------------------------------------------------------------------
tmpdir
    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.
tmpdir_factory
    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/main.py", 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/python.py", line 1025, in _show_fixtures_per_test
INTERNALERROR>     write_item(item)
INTERNALERROR>   File "/home/oliver/.virtualenvs/tmp/lib/python3.6/site-packages/_pytest/python.py", 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

piplist

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/pytest.py
setuptools registered plugins:
  pytest-xdist-1.20.0 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/xdist/plugin.py
  pytest-xdist-1.20.0 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/xdist/looponfail.py
  pytest-timeout-1.2.0 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/pytest_timeout.py
  pytest-forked-0.2 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/pytest_forked/__init__.py
  pytest-cov-2.5.1 at /home/oliver/.virtualenvs/tox/lib/python3.6/site-packages/pytest_cov/plugin.py
@obestwalter
Copy link
Member Author

obestwalter commented Sep 18, 2017

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

@nicoddemus nicoddemus added type: bug problem that needs to be addressed topic: reporting related to terminal output and user-facing messages and errors labels Sep 18, 2017
@nicoddemus
Copy link
Member

Thanks @obestwalter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: reporting related to terminal output and user-facing messages and errors type: bug problem that needs to be addressed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants