-
Notifications
You must be signed in to change notification settings - Fork 340
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
Update the testing guide within the development guide #1163
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1163 +/- ##
=======================================
Coverage ? 97.06%
=======================================
Files ? 73
Lines ? 7093
Branches ? 0
=======================================
Hits ? 6885
Misses ? 208
Partials ? 0 Continue to review full report at Codecov.
|
I'd like to finish this for 0.7.0 so I tentatively marked that milestone, but I'll probably need to limit the scope of this PR and make updates for 0.8.0 in a separate PR. |
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.
This honestly LGTM. Added a single fix to the style check guide.
Also, black is not quite pep8.
So I don't forget from today's community meeting...
|
Co-authored-by: Dominik Stańczak <[email protected]>
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.
Looks good! A couple minor suggestions and ideas, but I'd be happy to have it merged as is.
* Use the ``--pdb`` flag to enter the `Python debugger`_ upon test | ||
failures. | ||
|
||
Using tox |
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.
There was some package I saw that had a similar section in their documentation. It went like this:
Using tox
Use tox
for testing. Tox has many flags.
docs/development/testing_guide.rst
Outdated
Types of tests | ||
============== |
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.
Perhaps we could move this section into a subpage, so we can direct new contributors here, but still give them the option of a deeper dive?
Best practices | ||
============== |
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.
Maybe unintuitively, but I think this is completely fine to keep here, as opposed to the previous section where you asked this question. It's a great summary that should leave people with a sense of not just knowing how to mechanically implement tests, but also how to... strategically approach them? The testing metagame, if you excuse my lack of better phrase at the moment?
@pytest.mark.slow | ||
def test_calculating_primes(): | ||
calculate_all_primes() |
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.
Shouldn't this be parametrized somehow? 😜
Co-authored-by: Dominik Stańczak <[email protected]>
Co-authored-by: Dominik Stańczak <[email protected]>
Co-authored-by: Dominik Stańczak <[email protected]>
Co-authored-by: Dominik Stańczak <[email protected]>
pre-commit.ci autofix |
Co-authored-by: Dominik Stańczak <[email protected]>
@etjohnson and @StanczakDominik — Thank you for the helpful reviews! My main changes were implementing most or all the changes that you suggested, revising the section on running different tox test environments, moving the definitions of unit & integration tests to the glossary page, and adding an image that shows the GitHub Actions checks. We could expand the discussion on fixtures in another pull request if we'd like. Thank you again! |
* Update testing guide in development guide * Add pytest to intersphinx * Update testing guide * Add changelog entry * Minor updates to testing guide * Retitle testing guide * Update docs/development/testing_guide.rst Co-authored-by: Dominik Stańczak <[email protected]> * Rearrange test guide * Update preamble for testing guide * Updates to testing guide * Minor updates to testing guide * Remove run_test section * Add link to create an issue to update testing guide * Add to common links * Update testing guide * More updates to testing guide * Update list of testing best practices * Apply suggestions from code review Co-authored-by: Dominik Stańczak <[email protected]> * Revise testing guide * Fix duplicate links and reST problems * Update testing guide * Update testing guide * Use in-line link * Update code coverage section * Fix placement of comment to ignore func in coverage tests * Update code coverage section * Add unit & integration testing to glossary * Fix spacing in math with units example * Update testing guide * Update testing guidelines * Add and update bibliography.rst * Update sections on unit & integration testing * Update testing best practices * Delete commented out text The text removed here may be worth revisiting if this section were to be revised. * Delete commented out text The text removed here may be worth revisiting if this section were to be revised. * Put bibliography entries back into testing guide To avoid having this pull request about multiple things, I decided to hold off on the new bibliography page. In particular, I was thinking that the pull request that adds the bibliography should also include edits to the section of doc_guide.rst that describes how to do references. * Minor updates to testing guide * Fix reference * Use common links for black and isort * Fix reST error & broken link * Update changelog entry * Add Wilson2014 reference * Future proof the docs * Clarify reasons for dev test failures Co-authored-by: Dominik Stańczak <[email protected]> * Improve grammar Co-authored-by: Dominik Stańczak <[email protected]> * Update docs/development/testing_guide.rst Co-authored-by: Dominik Stańczak <[email protected]> * Improve discussion of fixtures Co-authored-by: Dominik Stańczak <[email protected]> * Update discussion on running slow tests Co-authored-by: Dominik Stańczak <[email protected]> * Update common links & use them in index.rst * Move unit/integration test defs to glossary * Add image for results of pull request checks * Add image of pull request checks * Fix image path * Update text around image of pull request checks * Suggest using assert_allclose & astropy equivalent * Revamp section on running tests with tox Co-authored-by: Dominik Stańczak <[email protected]>
* Update testing guide in development guide * Add pytest to intersphinx * Update testing guide * Add changelog entry * Minor updates to testing guide * Retitle testing guide * Update docs/development/testing_guide.rst Co-authored-by: Dominik Stańczak <[email protected]> * Rearrange test guide * Update preamble for testing guide * Updates to testing guide * Minor updates to testing guide * Remove run_test section * Add link to create an issue to update testing guide * Add to common links * Update testing guide * More updates to testing guide * Update list of testing best practices * Apply suggestions from code review Co-authored-by: Dominik Stańczak <[email protected]> * Revise testing guide * Fix duplicate links and reST problems * Update testing guide * Update testing guide * Use in-line link * Update code coverage section * Fix placement of comment to ignore func in coverage tests * Update code coverage section * Add unit & integration testing to glossary * Fix spacing in math with units example * Update testing guide * Update testing guidelines * Add and update bibliography.rst * Update sections on unit & integration testing * Update testing best practices * Delete commented out text The text removed here may be worth revisiting if this section were to be revised. * Delete commented out text The text removed here may be worth revisiting if this section were to be revised. * Put bibliography entries back into testing guide To avoid having this pull request about multiple things, I decided to hold off on the new bibliography page. In particular, I was thinking that the pull request that adds the bibliography should also include edits to the section of doc_guide.rst that describes how to do references. * Minor updates to testing guide * Fix reference * Use common links for black and isort * Fix reST error & broken link * Update changelog entry * Add Wilson2014 reference * Future proof the docs * Clarify reasons for dev test failures Co-authored-by: Dominik Stańczak <[email protected]> * Improve grammar Co-authored-by: Dominik Stańczak <[email protected]> * Update docs/development/testing_guide.rst Co-authored-by: Dominik Stańczak <[email protected]> * Improve discussion of fixtures Co-authored-by: Dominik Stańczak <[email protected]> * Update discussion on running slow tests Co-authored-by: Dominik Stańczak <[email protected]> * Update common links & use them in index.rst * Move unit/integration test defs to glossary * Add image for results of pull request checks * Add image of pull request checks * Fix image path * Update text around image of pull request checks * Suggest using assert_allclose & astropy equivalent * Revamp section on running tests with tox Co-authored-by: Dominik Stańczak <[email protected]>
There are a couple of parts of our testing guide that have become out-of-date. For example, we no longer use Travis CI or AppVeyor. This PR is intended to update the testing guide to make it more up-to-date.
This is a companion pull request to #1156.