-
Notifications
You must be signed in to change notification settings - Fork 347
Fix classmethod check for mixin case #618
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
Conversation
I have a case of using a mixin on my test classes that started failing with 3.3.0 in upgrade PR adamchainz/django-mysql#484. It was caused by pytest-dev#598. It looks like this was actually a latent failure in the way `_classmethod_is_defined_at_leaf` was picking the 'super method' - it would iterate further up the tree despite coming across the next method in the resolution chain. Also by not using `__mro__` the order of the base classes wasn't strictly being observed, although I don't think that affects my mixin case. Added a test that fails before and passes after.
Codecov Report
@@ Coverage Diff @@
## master #618 +/- ##
==========================================
+ Coverage 92.28% 92.31% +0.02%
==========================================
Files 32 32
Lines 1698 1704 +6
Branches 142 142
==========================================
+ Hits 1567 1573 +6
Misses 94 94
Partials 37 37
Continue to review full report at Codecov.
|
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.
LGTM, pushed a fixup to ignore branch coverage with the for-loop.
🍝 |
Fixes regression in #598. It looks like this was actually a latent failure in the way `_classmethod_is_defined_at_leaf` was picking the 'super method' - it would iterate further up the tree despite coming across the next method in the resolution chain. Also by not using `__mro__` the order of the base classes wasn't strictly being observed, although I don't think that affects my mixin case. Added a test that fails before and passes after. Closes pytest-dev/pytest-django#618.
I have a case of using a mixin on my test classes that started failing with 3.3.0 in upgrade PR adamchainz/django-mysql#484. It was caused by #598.
It looks like this was actually a latent failure in the way
_classmethod_is_defined_at_leaf
was picking the 'super method' - it would iterate further up the tree despite coming across the next method in the resolution chain. Also by not using__mro__
the order of the base classes wasn't strictly being observed, although I don't think that affects my mixin case.Added a test that fails before and passes after.