-
Notifications
You must be signed in to change notification settings - Fork 30
update Python testing section #220
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
Comments
The second to last paragraph can also be removed if we remove |
I mostly agree, though as far as I know there is no substitute for |
I didn't know about pytest-mock, but I've been using MagicMock and patch for years with pytest, works fine. Maybe a note should be added that there are many useful pytest plug-ins in general? I use several for linting, like pytest-pycodestyle and pytest-mypy, and it's quite convenient. If you're new to pytest, that may be nice to know. |
|
More plugin info: https://docs.pytest.org/en/stable/plugins.html |
Ah yes, I can recommend pytest-cov and pytest-xdist. The latter was useful in Cerise, where I had to build Docker images as part of the tests, and with xdist that could be done in parallel, which sped things up a lot. |
Ok, great comments, I tried to sum it all up in an updated section, please check it out in #219. Accidentally pushed it to that PR branch, which in the end I think is fine, because it was only a link fix and wasn't merged yet anyway. |
The Python testing section imho can be trimmed a bit and needs to be updated. The current section reads:
I would suggest removing
unittest
altogether, since we recommendpytest
. We don't need to list all alternatives.The bottom paragraph should be removed altogether, since the
test
command in setuptools has been deprecated: pypa/setuptools#1878 pytest-dev/pytest#5534Any objections, additions or other thoughts? If not, I'll make a PR or if someone else wants to do it, by all means :)
The text was updated successfully, but these errors were encountered: