coverage.py does not cover script if py.test executes it from another directory

前端 未结 4 1483
眼角桃花
眼角桃花 2020-12-25 12:23

I got a python script which takes command line arguments, working with some files. I\'m writing succeeding tests with py.test putting this script through its pa

4条回答
  •  一生所求
    2020-12-25 12:58

    according to this blog: https://thomas-cokelaer.info/blog/2017/01/pytest-cov-collects-no-data-on-travis/

    You should add all the __init__.py files in tests folder! This solution works for me.

提交回复
热议问题