Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

willingc
Copy link
Contributor

@willingc willingc commented Mar 17, 2025

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.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 17, 2025
Copy link
Contributor

@TimMonko TimMonko left a 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]`.
Copy link
Contributor

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

Copy link
Contributor

@TimMonko TimMonko Mar 17, 2025

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?

Copy link
Contributor Author

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]
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation about avoiding segfaults in Qt tests
3 participants