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:
parent
3b14a4f0e5
commit
60d09fe748
1 changed files with 2 additions and 0 deletions
|
@ -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__]),
|
||||
|
|
Loading…
Reference in a new issue