My project folder(yeah - I know it's best practice) is something like:
.
├── app.py
├── otherscript.py
├── tests/
└── tools/
├── __init__.py
└── toolfile.py
I need nose --with-coverage
to test the .py
scripts in the main folder, tools
folder and exclude the tests
folder (although I don't really care about excluding that)
When I run basic
nose --with-coverage
I get coverage on all installed dependencies and libs (flask, requests, etc)
when I run
nose --with-coverage --cover-package=folder name (or . or ./)
I get coverage for the tests folder. the tools/__init__.py
file and app.py
but not for the rest of the scripts:
> (opentaba-server) D:\username\pathto\opentaba-server>nosetests --with-coverage -- cover-package=./ ... Name
> Stmts Miss Cover Missing
> ----------------------------------------------------------------------- Tests\functional_tests\test_return_json 26 0 100%
> Tests\unit_test\test_createdb 0 0 100%
> Tests\unit_test\test_scrape 0 0 100% app
> 63 15 76% 22, 24, 72-81, 8 8-106, 133 tools\__init__
> 0 0 100%
> ----------------------------------------------------------------------- TOTAL 89 15 83%
> ---------------------------------------------------------------------- Ran 3 tests in 5.182s OK
When I run with the --cover-inclusive flag
. It just fails with :
nosetests-scripts.py: error: no such option: --with-coverage
I'll be glad for any help with this
--with-xunit
as well. I spent about 1 hour trying to get the--xunit-file
option to work without specifying the--with-xunit
option. Pretty big waste of time... – Knipe