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

Add tests/more tests to widgets with low coverage #5864

Merged
merged 10 commits into from Jun 22, 2023

Conversation

dalthviz
Copy link
Member

@dalthviz dalthviz commented May 23, 2023

Description

  • Add more tests for QColorSwatch related widgets
  • Add test for QtToolTipLabel
  • Add test for QtPluginSorter

Notes

While checking the addition of new tests to widgets using the code coverage as guidance, seems like a widget which doesn't have coverage at all exist: QtDictTable. But more interestingly, seems like this widget is not used anymore? I was unable to find a place inside napari source code where this widget is used. Maybe it should be removed or moved to an upstream project like superqt?

Type of change

  • Tests improvements/additions

How has this been tested?

  • all tests pass with my change
  • I check if my changes works with both PySide and PyQt backends
    as there are small differences between the two Qt bindings.

Final checklist:

  • My PR is the minimum possible work for the desired functionality

@dalthviz dalthviz added tests Something related to our tests maintenance PR with maintance changes, labels May 23, 2023
@dalthviz dalthviz self-assigned this May 23, 2023
@github-actions github-actions bot added the qt Relates to qt label May 23, 2023
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Merging #5864 (ed41bef) into main (9d0dfef) will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5864      +/-   ##
==========================================
+ Coverage   90.17%   90.26%   +0.09%     
==========================================
  Files         615      617       +2     
  Lines       51879    51927      +48     
==========================================
+ Hits        46782    46874      +92     
+ Misses       5097     5053      -44     
Impacted Files Coverage Δ
napari/_qt/widgets/_tests/test_qt_color_swatch.py 100.00% <100.00%> (ø)
napari/_qt/widgets/_tests/test_qt_plugin_sorter.py 100.00% <100.00%> (ø)
napari/_qt/widgets/_tests/test_qt_tooltip.py 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

@dalthviz dalthviz marked this pull request as ready for review June 15, 2023 16:29
@dalthviz dalthviz changed the title [WIP] Add tests/more tests to widgets with low coverage Add tests/more tests to widgets with low coverage Jun 15, 2023
@jni jni added this to the 0.5.0 milestone Jun 22, 2023
@jni jni merged commit f61e738 into napari:main Jun 22, 2023
35 checks passed
melissawm pushed a commit to melissawm/napari that referenced this pull request Jul 3, 2023
# Description

* [x] Add more tests for `QColorSwatch` related widgets
* [x] Add test for `QtToolTipLabel`
* [x] Add test for `QtPluginSorter`

## Notes

While checking the addition of new tests to widgets using the [code
coverage as
guidance](https://app.codecov.io/gh/napari/napari/tree/main/napari/_qt/widgets),
seems like a widget which doesn't have coverage at all exist:
`QtDictTable`. But more interestingly, seems like this widget is not
used anymore? I was unable to find a place inside napari source code
where this widget is used. Maybe it should be removed or moved to an
upstream project like `superqt`?
GenevieveBuckley pushed a commit that referenced this pull request Aug 1, 2023
# Description

Adds a test for the `QtToolTipEventFilter` as a continuation of the
effort started at #5864 to increase Qt widgets/code coverage

## Type of change
- [x] Tests improvements/additions

# How has this been tested?
- [x] all tests pass with my change
- [x] I check if my changes works with both PySide and PyQt backends
      as there are small differences between the two Qt bindings.  

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
dstansby pushed a commit to dstansby/napari that referenced this pull request Aug 2, 2023
# Description

Adds a test for the `QtToolTipEventFilter` as a continuation of the
effort started at napari#5864 to increase Qt widgets/code coverage

## Type of change
- [x] Tests improvements/additions

# How has this been tested?
- [x] all tests pass with my change
- [x] I check if my changes works with both PySide and PyQt backends
      as there are small differences between the two Qt bindings.  

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
jni added a commit that referenced this pull request Aug 19, 2023
# Fixes/Closes

closes #6078 

# Description

Adds some tests to the `ScreenshotDialog` as a continuation of the
effort started at #5864 to increase Qt widgets code coverage and fixes
some errors with the non-native version (the one used when launching
napari from and IPython console)

## Notes and questions

* The tests call the dialog `show` method and also sets the non-native
option so the tests here only cover the case when napari is being
launched from an IPython console. The testing of the OS native version
of the dialog is more involved.
* Checking the code related with the dialogs available I noticed that
some of them (files/widgets classes) have the `qt_*` /`Qt` prefix or the
`_dialog`/`Dialog` suffix but others don't (for example
`screenshot_dialog.py/ScreenshotDialog` vs `qt_about/QtAbout`). Is that
something worthy to standardize or maybe there is already some logic
behind the naming?

---------

Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Co-authored-by: Genevieve Buckley <30920819+GenevieveBuckley@users.noreply.github.com>
Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com>
Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Czaki added a commit that referenced this pull request Oct 17, 2023
# Fixes/Closes

closes #6078 

# Description

Adds some tests to the `ScreenshotDialog` as a continuation of the
effort started at #5864 to increase Qt widgets code coverage and fixes
some errors with the non-native version (the one used when launching
napari from and IPython console)

## Notes and questions

* The tests call the dialog `show` method and also sets the non-native
option so the tests here only cover the case when napari is being
launched from an IPython console. The testing of the OS native version
of the dialog is more involved.
* Checking the code related with the dialogs available I noticed that
some of them (files/widgets classes) have the `qt_*` /`Qt` prefix or the
`_dialog`/`Dialog` suffix but others don't (for example
`screenshot_dialog.py/ScreenshotDialog` vs `qt_about/QtAbout`). Is that
something worthy to standardize or maybe there is already some logic
behind the naming?

---------

Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Co-authored-by: Genevieve Buckley <30920819+GenevieveBuckley@users.noreply.github.com>
Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com>
Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance PR with maintance changes, qt Relates to qt tests Something related to our tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants