nedbat / coveragepy

The code coverage tool for Python
https://coverage.readthedocs.io
Apache License 2.0
2.98k stars 429 forks source link

coverage report: directories / packages as arguments #424

Open nedbat opened 8 years ago

nedbat commented 8 years ago

Originally reported by René Fleschenberg (Bitbucket: rfleschenberg, GitHub: rfleschenberg)


The coverage report command accepts a list of Python files to restrict output to those files / modules. It would be nice if one could also specify a directory / package. Currently, this doesn't work:

(django-shop)rene@rene ~/django-shop (money-tests) $ coverage report shop/money/
Name          Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------
shop/money/   NoSource: No source for code: '/home/rene/django-shop/shop/money': [Errno 21] Is a directory: '/home/rene/django-shop/shop/money'
No data to report.
(django-shop)rene@rene ~/django-shop (money-tests) $ ls shop/money 
fields.py  fields.pyc  __init__.py  __init__.pyc  iso4217.py  iso4217.pyc  money_maker.py  money_maker.pyc  serializers.py
(django-shop)rene@rene ~/django-shop (money-tests) $ 

nedbat commented 7 years ago

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


The documentation claims it is possible to specify modules or files. It would be nice to specify a directory as an equivalent of specifying all files within that directory.