-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fix IntEnum for python 3.11 #205
Conversation
WalkthroughThe changes enhance the robustness of the Changes
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Files selected for processing (2)
- src/superqt/combobox/_enum_combobox.py (1 hunks)
- tests/test_enum_comb_box.py (3 hunks)
Files skipped from review due to trivial changes (1)
- src/superqt/combobox/_enum_combobox.py
Additional comments (Suppressed): 3
tests/test_enum_comb_box.py (3)
1-4: The import of
IntEnum
is new and necessary for the newly introducedIntEnum1
class. This change seems appropriate.39-42: A new
IntEnum1
class is introduced, extending fromIntEnum
. This class is used in the new test functiontest_simple_create_int_enum
.140-144: A new test function
test_simple_create_int_enum
is added. It creates aQEnumComboBox
withIntEnum1
as the enum class and verifies that the combo box correctly displays the enum values. The test seems to be well written and covers the necessary assertions.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
=======================================
Coverage 87.30% 87.30%
=======================================
Files 45 45
Lines 3324 3325 +1
=======================================
+ Hits 2902 2903 +1
Misses 422 422
☔ View full report in Codecov by Sentry. |
Thank you! And thanks also for the explanation |
Closes #202
The error described in #202 is Python 3.11 specific. Caused by this change:
Described in documentation.
I have changed the
_get_name
strategy to assume that if we cannot determine the__str__
module, then we could assume that it is not overwritten by the user and use the default strategy.Summary by CodeRabbit
_get_name
function insrc/superqt/combobox/_enum_combobox.py
to handle cases where the__str__
method of theenum_value
object is overridden or belongs to a different module. This ensures more robust and reliable functionality.test_simple_create_int_enum
intests/test_enum_comb_box.py
to verify the correct creation of aQEnumComboBox
with anIntEnum1
class, improving the overall test coverage.