Skip to content

Fix python setup.py test to run doctests. #132

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

Merged
merged 1 commit into from
Jan 17, 2019
Merged

Conversation

pelson
Copy link
Member

@pelson pelson commented Jan 17, 2019

By defining the tests to be in cf_units/tests we are excluding doctests found in cf_units when running python setup.py test (which is the case in our CI). Locally, I personally run pytest cf_units which actually fails with a few doctests.

This changes the config so that python setup.py test identifies the doctests in cf_units, and fixes the few tests that were failing.

For the record, it took me a deal of time to figure out what was going on. I was making sure that setup.cfg could actually handle pytest aliases and addopts, started down the line of implementing a pytest.ini to see if that was the issue. A couple of issues that came up (pytest-dev/pytest-runner#18, astropy/astropy#6513) were red-herrings - this was simply fixed by the fact that the testpaths were pointing to the test folder, and not the whole source folder!

@pelson
Copy link
Member Author

pelson commented Jan 17, 2019

Hopefully coveralls will come back and say that coverage has increased (markedly). This will be the thing that gives us confidence in the future that this hasn't regressed (because a regression would mean that we run fewer tests).

@coveralls
Copy link

Coverage Status

Coverage increased (+1.3%) to 89.568% when pulling 0b3fbcf on pelson:doctest into 502d014 on SciTools:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+1.3%) to 89.568% when pulling 0b3fbcf on pelson:doctest into 502d014 on SciTools:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.3%) to 89.568% when pulling 0b3fbcf on pelson:doctest into 502d014 on SciTools:master.

@pelson pelson requested a review from bjlittle January 17, 2019 05:22
@bjlittle bjlittle self-assigned this Jan 17, 2019
@bjlittle
Copy link
Member

bjlittle commented Jan 17, 2019

Awesome, thanks @pelson 👍

@bjlittle bjlittle merged commit c6ef762 into SciTools:master Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants