-
Notifications
You must be signed in to change notification settings - Fork 221
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 typing #658
base: master
Are you sure you want to change the base?
Fix typing #658
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #658 +/- ##
==========================================
- Coverage 95.58% 95.49% -0.09%
==========================================
Files 49 49
Lines 1788 1819 +31
Branches 193 195 +2
==========================================
+ Hits 1709 1737 +28
- Misses 52 54 +2
- Partials 27 28 +1 ☔ View full report in Codecov by Sentry. |
It was never supposed to return a callable with the same ParamSpec
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.
PR Type: Refactoring
PR Summary: The pull request introduces a refactoring that replaces private attributes with WeakKeyDictionary registries to manage scenarios and reports within the pytest_bdd framework. This change aims to fix typing issues and improve the handling of object lifecycles by avoiding strong reference cycles that can lead to memory leaks.
Decision: Comment
📝 Type: 'Refactoring' - not supported yet.
- Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
📝 Complexity: the changes are too large or complex for Sourcery to approve.
- Unsupported files: the diff contains files that Sourcery does not currently support during reviews.
General suggestions:
- Ensure that the new registry-based approach is thoroughly tested, especially in scenarios with complex fixture setups and teardowns.
- Consider adding inline comments explaining the choice of WeakKeyDictionary for future maintainers.
- Review the changes to ensure that all references to the old attribute-based approach have been properly updated to the new registry-based approach.
Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨
Well, mypy is happy only because we put a lot of |
Good point - so the focus of this would be to eliminate those where possible :) |
Fix many
mypy
issues.Notably, I replace private attributes like
__scenario__
,__scenario_report__
, etc. with registries (WeakKeyDictionary). E.g.