Skip to content

Conversation

tlambert03
Copy link
Member

@tlambert03 tlambert03 commented Aug 22, 2025

This follows up on #463, adding a test that catches a number of additional missed cases where the core wasn't passed through

It adds a very useful fixture called assert_max_instance_depth ... which I used to catch most of these errors. But there are still a couple errors remaining in test_useq_core_widgets.py and test_config_groups_widgets.py ... so it's commented out for now.

cc @gselzer if you're curious

@tlambert03 tlambert03 changed the title Catch missing core fix: propagate mmcore instance to various widget constructors Aug 22, 2025
Copy link

codecov bot commented Aug 22, 2025

Codecov Report

❌ Patch coverage is 70.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.80%. Comparing base (eb950ad) to head (f2d1bf0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
..._group_preset_widget/_group_preset_table_widget.py 0.00% 4 Missing ⚠️
src/pymmcore_widgets/control/_rois/_vispy.py 0.00% 3 Missing ⚠️
..._presets/_objectives_pixel_configuration_widget.py 50.00% 1 Missing ⚠️
src/pymmcore_widgets/control/_objective_widget.py 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (70.00%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #469      +/-   ##
==========================================
+ Coverage   87.77%   87.80%   +0.02%     
==========================================
  Files         106      106              
  Lines       11668    11665       -3     
==========================================
  Hits        10242    10242              
+ Misses       1426     1423       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gselzer
Copy link
Contributor

gselzer commented Aug 25, 2025

Looks nice...it'd be great if we can fix the remaining test failures such that the fixture could be uncommented. I filed a PR to that branch doing so for one of the failing test files, and could look at the other if that'd be helpful.

@tlambert03
Copy link
Member Author

thanks @gselzer. Yes it would be nice, but these are tricky cases for a reason, and I'm not yet ready to go down the path that your PR goes down. The whole point of the new config model was to not need a constant core connection, but rather convert the core into pure model objects (so, we shouldn't need a constant core connection there just to get an icon... it's a leaky abstraction at the moment, but the fix is to grab the device type at model creation time, not to preserve the core). we can get to it soon enough. This PR is already a significant improvement, and I don't want to hold up the "good" for the "perfect".

@tlambert03 tlambert03 merged commit acf92ad into pymmcore-plus:main Aug 25, 2025
22 of 23 checks passed
@tlambert03 tlambert03 deleted the catch-missing-core branch August 25, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants