1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Ignore DoctestTextfile when collecting

Prevents this error:

    $ tox -e py27 -- -m unit
    ...
    INTERNALERROR>   File "/Users/marca/dev/git-repos/pip/tests/conftest.py", line 16, in pytest_collection_modifyitems
    INTERNALERROR>     item.module.__file__,
    INTERNALERROR> AttributeError: 'DoctestTextfile' object has no attribute 'module'
This commit is contained in:
Marc Abramowitz 2015-03-19 14:24:25 -07:00
parent 3b14a4f0e5
commit 60d09fe748

View file

@ -12,6 +12,8 @@ from tests.lib.venv import VirtualEnvironment
def pytest_collection_modifyitems(items):
for item in items:
if not hasattr(item, 'module'): # e.g.: DoctestTextfile
continue
module_path = os.path.relpath(
item.module.__file__,
os.path.commonprefix([__file__, item.module.__file__]),