8000 Replace duck-typing check with isinstance check for QRangeSlider by jni · Pull Request #7712 · napari/napari · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace duck-typing check with isinstance check for QRangeSlider #7712

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

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

jni
Copy link
Member
@jni jni commented Mar 17, 2025

In #5757, we added a test for sliders in layer controls that checked for ranged
sliders by checking for the presence of a private attribute _valuesChanged.
It's bad practice to check for private attributes in outside libraries. This
instead checks for the correct class in superqt.

See also: pyapp-kit/superqt#283

Copy link
codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.85%. Comparing base (cb6f6e6) to head (33df7d4).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7712      +/-   ##
==========================================
- Coverage   92.88%   92.85%   -0.04%     
==========================================
  Files         633      633              
  Lines       59430    59431       +1     
==========================================
- Hits        55201    55182      -19     
- Misses       4229     4249      +20     

☔ 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.

@jni jni added this to the 0.6.0 milestone Mar 17, 2025
@jni jni added the maintenance PR with maintance changes, label Mar 17, 2025
@jni jni merged commit 876965f into napari:main Mar 17, 2025
42 checks passed
jni added a commit that referenced this pull request Mar 18, 2025
…7719)

In #7712, I missed one more "hasattr" check for a private attribute.
This one replaces it with an isinstance check.
Czaki pushed a commit to jni/napari that referenced this pull request Mar 20, 2025
…apari#7719)

In napari#7712, I missed one more "hasattr" check for a private attribute.
This one replaces it with an isinstance check.
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.

2 parti 33B6 cipants
0