Skip to content

Absolute paths in report when using pytest and ./setup.py install #197

@homm

Description

@homm

Hello! I'm working on Pillow and after transiting from nose to pytest we are faced with the problem that all reports are looks like this one:

https://travis-ci.org/python-pillow/Pillow/jobs/365242667#L4305

/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImageMode.py                24      0   100%
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImageMorph.py              104      0   100%
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImageOps.py                205     18    91%
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImagePalette.py            117      3    97%
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImagePath.py                 2      0   100%
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImageQt.py                 101     78    23%
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImageSequence.py            23      1    96%
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImageShow.py                96     40    58%
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImageStat.py                88      0   100%
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/Pillow-5.2.0.dev0-py3.6-linux-x86_64.egg/PIL/ImageTk.py                 128    102    20%

All paths are absolute. And these paths are sent in Coveralls, that why we have hundreds of source files in Coveralls reports with duplicates for each python versions we have:

https://coveralls.io/builds/16466459#source-files-datatable

We are building the library using ./setup.py build_ext and install commands and then runing pytest this way.

I also check pytest with ./setup.py install on different repo, it behaves exactly the same: paths are absolute:

$ pytest --cov pillow_lut
===================================================== test session starts ======================================================
platform linux2 -- Python 2.7.6, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
rootdir: /home/homm/Code/pillow-lut-tools, inifile:
plugins: cov-2.5.1, django-webtest-1.9.2, celery-4.1.0
collected 36 items                                                                                                             

tests/test_generators.py ..........                                                                                      [ 27%]
tests/test_loaders.py ........                                                                                           [ 50%]
tests/test_operations.py ..................                                                                              [100%]

---------- coverage: platform linux2, python 2.7.6-final-0 -----------
Name                                                                                                     Stmts   Miss  Cover
----------------------------------------------------------------------------------------------------------------------------
/home/homm/env/env_ucare/lib/python2.7/site-packages/pillow_lut-1.0-py2.7.egg/pillow_lut/__init__.py         6      0   100%
/home/homm/env/env_ucare/lib/python2.7/site-packages/pillow_lut-1.0-py2.7.egg/pillow_lut/generators.py     220      0   100%
/home/homm/env/env_ucare/lib/python2.7/site-packages/pillow_lut-1.0-py2.7.egg/pillow_lut/loaders.py         69      1    99%
/home/homm/env/env_ucare/lib/python2.7/site-packages/pillow_lut-1.0-py2.7.egg/pillow_lut/operations.py     123      0   100%
/home/homm/env/env_ucare/lib/python2.7/site-packages/pillow_lut-1.0-py2.7.egg/pillow_lut/utils.py            9      5    44%
----------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                      427      6    99%


============================================ 36 passed in 2.50 seconds =============================================



$ nosetests Tests --with-coverage --cover-package=pillow_lut
....................................
Name                       Stmts   Miss  Cover
----------------------------------------------
pillow_lut/__init__.py         6      0   100%
pillow_lut/generators.py     220      0   100%
pillow_lut/loaders.py         69      1    99%
pillow_lut/operations.py     123      0   100%
pillow_lut/utils.py            9      5    44%
----------------------------------------------
TOTAL                        427      6    99%
----------------------------------------------------------------------
Ran 36 tests in 1.986s

OK

Do you have any advises how to avoid this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions