-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add info on testing QWidget
visibility
#370
Conversation
|
||
## Running tests | ||
|
||
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]`. | ||
|
||
There are a very small number of tests (<5) that require showing GUI elements, (such |
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.
hahahaha
Looks good to me! 👍 |
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.
Love it 🎉 ! This is great. This whole guide is pretty useful... I wonder how many people know it's there 😬
Pytest fixtures to aid testings live in: | ||
|
||
* [`napari/conftest.py`](https://github.com/napari/napari/blob/main/napari/conftest.py) | ||
* [`napari_builtins/_tests/conftest.py`](https://github.com/napari/napari/blob/main/napari_builtins/_tests/conftest.py) |
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 would put this separately and mention that it's fixtures for the builtins
plugin
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.
Will do, but I think we need a section describing what the builtins plugin is. see: #321
* [`napari_builtins/_tests/conftest.py`](https://github.com/napari/napari/blob/main/napari_builtins/_tests/conftest.py) | ||
* [`napari/utils/_testsupport.py`](https://github.com/napari/napari/blob/main/napari/utils/_testsupport.py) | ||
|
||
These fixtures from are available globally to all of `napari`. |
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 don't think the napari_builtins
ones are available to napari
tests (or vice versa) as they are in separate directories
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.
Fixed!
Thanks for review @DragaDoncila, changes made! |
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.
Awesome, thank you @lucyleeow 🙏
References and relevant issues
Follow on from napari/napari#6722
Description
QWidget
visibility. I was not sure if this info was relevant more generally beyondQWidget
s (e.g., forQWindow
?). Happy to change._testsupport.py
is exported, see: https://github.com/napari/napari/blob/27851ee92913e02b16d05b0aba19b126fa1e29e3/pyproject.toml#L191C24-L191C36