Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't (figure out how to) run coverage #38

Closed
tedder opened this issue Feb 7, 2016 · 3 comments
Closed

can't (figure out how to) run coverage #38

tedder opened this issue Feb 7, 2016 · 3 comments
Labels

Comments

@tedder
Copy link
Contributor

tedder commented Feb 7, 2016

I'm hoping someone here can point me in the right direction- I can bump up the unit test coverage if I can get pycov working.

$ py.test --cov-config .coveragerc --cov=twtxt 
========================================== test session starts ==========================================
platform darwin -- Python 3.4.3, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
rootdir: /Users/ted/git/twtxt, inifile: 
plugins: cov-2.2.1
collected 6 items 

tests/test_types.py ......Coverage.py warning: No data was collected.
$ py.test --cov-config .coveragerc --cov=twtxt tests/
========================================== test session starts ==========================================
platform darwin -- Python 3.4.3, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
rootdir: /Users/ted/git/twtxt, inifile: 
plugins: cov-2.2.1
collected 6 items 

tests/test_types.py ......Coverage.py warning: No data was collected.

This one gives approximately the same coverage percent (13%) as the repo shows, but is obviously incorrect:

$ py.test --cov-config .coveragerc --cov=. tests/
========================================== test session starts ==========================================
platform darwin -- Python 3.4.3, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
rootdir: /Users/ted/git/twtxt, inifile: 
plugins: cov-2.2.1
collected 6 items 

tests/test_types.py ......
---------------------------- coverage: platform darwin, python 3.4.3-final-0 ----------------------------
Name               Stmts   Miss  Cover
--------------------------------------
setup                  5      5     0%
tests/test_types      63      0   100%
twtxt/__init__         0      0   100%
twtxt/cli            114    114     0%
twtxt/config          87     87     0%
twtxt/file            20     20     0%
twtxt/helper          47     47     0%
twtxt/http            49     49     0%
twtxt/log             10     10     0%
twtxt/parser          23     23     0%
twtxt/types           51     51     0%
--------------------------------------
TOTAL                469    406    13%

======================================= 6 passed in 0.09 seconds ========================================

@timofurrer
Copy link
Contributor

I had the same issues when I did #29 . I thought it's a problem from pycov in combination with tox because tox moves the code base to a tmp location - and thus doesn't file it's files anymore. I could fix it with the usedevelop=True in tox.

I suggest you wait until #29 is merged or rejected ..

@buckket
Copy link
Owner

buckket commented Feb 8, 2016

You can run the tests, including coverage, simply by running make test.
(which executes: py.test --tb=short -v --cov twtxt/ tests/)

This works fine for me and provides correct results.

Don’t see why you think your result is incorrect, either.

@tedder
Copy link
Contributor Author

tedder commented Feb 8, 2016

aha, both those commands work, they don't have the "warning: No data was collected" message.

@tedder tedder closed this as completed Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants