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 extra garbage collection for some viewer tests #5108

Merged
merged 1 commit into from Sep 20, 2022

Conversation

andy-sweet
Copy link
Member

Description

This adds a special call to gc.collect to one of the viewer tests, so that any Viewer and QtViewer instances should not be present in future tests. That's particularly important for tests that call make_napari_viewer, which asserts that there are no QtViewer instances.

The hope is that this fixes the failing py310-windows-pyside2 tests on main. I was able to reproduce that failure and this fix did fix it.

Type of change

  • Bug-fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • all tests pass with my change

Final checklist:

  • My PR is the minimum possible work for the desired functionality
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • If I included new strings, I have used trans. to make them localizable.
    For more information see our translations guide.

@github-actions github-actions bot added the tests Something related to our tests label Sep 20, 2022
@github-actions
Copy link
Contributor

Click here to download the docs artifacts
docs
(zip file)

@codecov
Copy link

codecov bot commented Sep 20, 2022

Codecov Report

Merging #5108 (4b73273) into main (6cf965e) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5108      +/-   ##
==========================================
- Coverage   87.62%   87.61%   -0.01%     
==========================================
  Files         587      587              
  Lines       50049    50051       +2     
==========================================
  Hits        43854    43854              
- Misses       6195     6197       +2     
Impacted Files Coverage Δ
napari/_tests/test_view_layers.py 98.31% <100.00%> (+0.02%) ⬆️
...layers/image/experimental/_chunked_image_loader.py 88.00% <0.00%> (-8.00%) ⬇️
napari/layers/image/_image_slice.py 97.61% <0.00%> (-2.39%) ⬇️
napari/layers/image/image.py 95.59% <0.00%> (-0.25%) ⬇️
napari/utils/theme.py 89.79% <0.00%> (+0.68%) ⬆️
napari/utils/info.py 83.33% <0.00%> (+1.11%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Czaki Czaki added the bugfix PR with bugfix label Sep 20, 2022
@andy-sweet andy-sweet merged commit 95a57a9 into napari:main Sep 20, 2022
@andy-sweet andy-sweet deleted the gc-collect-viewer-test branch September 20, 2022 13:35
@andy-sweet andy-sweet added this to the 0.5.0 milestone Dec 8, 2022
@Czaki Czaki mentioned this pull request Jun 16, 2023
@Czaki Czaki modified the milestones: 0.5.0, 0.4.18 Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix tests Something related to our tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants