-
Notifications
You must be signed in to change notification settings - Fork 40
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
Edit testing doc and add admonition to Grzegorz blog post on Qt testing #635
base: main
Are you sure you want to change the base?
Conversation
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.
Overall great changes. Was about to play with some testing things (to see if I can replicate the Windows seg faults on my PC), so will use this PR as the resource and report back.
To run our test suite locally, run `pytest` on the command line. If, for some reason | ||
you don't already have the test requirements in your environment, run `python -m pip install -e .[testing]`. | ||
To run our test suite locally, run `pytest` on the command line. | ||
If you don't already have the test requirements installed in your environment, run `python -m pip install -e .[testing]`. |
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.
Ok, reporting back 🫡
[testing]
does not install tox. Would it be better to mentioned [dev]
here (to install tox) or later in the tox section? My preference would be to recommend installing [dev]
because its hard to imagine someone wanting to run tests locally without wanting to contribute somehow
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.
Edit: this coverage thing might be a local issue on my end
Reporting back again. I'm surprised that pytest-cov isn't part of any of our installs. The doc correctly states that for coverage with pytest that you will need to install pytest-cov. HOWEVER, it does not say that by default cov will be run if you just type in tox
(to grab whatever envs your local can produce) -- it will try to run with coverage but there is not install for this to happen.
Maybe pytest-cov should be added to dev
?
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've updated the command to install both just in case.
in your environment: | ||
|
||
```sh | ||
python -m pip install -e .[dev, testing] |
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.
dev
includes testing.
What is missing here is a Qt backend.
Maybe just point to setting up a dev install:
https://napari.org/stable/developers/contributing/dev_install.html#setting-up-a-development-installation
Co-authored-by: Tim Monko <[email protected]>
References and relevant issues
Closes #494
Description
This PR edits the testing page. After reviewing each section, I added
information that would be helpful for contributors. An admonition was
added to reference Grzegorz' blog post on avoiding segfaults in Qt tests.
Also rearranged some sections like mocking to group common tasks before specifics.