-
Notifications
You must be signed in to change notification settings - Fork 83
Add tox and change coverage configuration #311
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
Conversation
By making testing and coverage separate parts of the configuration, VSCode no longer chokes on discovering tests. This should also make test discovery easier in IDEs like PyCharm. The main problem was that coverage was being treated as default part of testing by always passing coverage flags to pytest (this was also noted in a comment in setup.cfg). Moving this to pyproject.toml may have been unnecessary in the end, but the resources I found online suggested this was the way to go. Adding tox provides a solution to NLeSC#38.
sverhoeven
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I depend on GH action to run my tests with different pythons, but doing it locally with tox is helpful.
Can you document a bit the usage of tox and pytest+coverage in the README.dev.md? Now that pytest does not automatically do coverage we should tell the template user about it in another way.
|
@sverhoeven Added documentation in 6d78d07. |
sverhoeven
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
In #311, I forgot to add the .tox directory to .gitignore. Tox stores environments and logs and such there.
This PR changes two things:
toxsupport, which provides a fix for Installing development tools #38 and is just generally nice to have (I personally always add it).coverageor by supplying the flags manually, like is being done in thesonarcloudActions workflow.Edit: also updated a broken link.