-
Notifications
You must be signed in to change notification settings - Fork 37
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
refactor: optimise session data structures #403
Conversation
Codecov Report
@@ Coverage Diff @@
## master #403 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 17 17
Lines 1001 1023 +22
=========================================
+ Hits 1001 1023 +22 |
_all_items: Dict["pytest.Item", bool] = attr.ib(factory=dict) | ||
_collected_items: Set["pytest.Item"] = attr.ib(factory=set) | ||
# All the selected test items. Will be set to False until the test item is run. | ||
_ran_items: Dict["pytest.Item", bool] = attr.ib(factory=dict) | ||
_selected_items: Dict[str, bool] = attr.ib(factory=dict) |
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.
This assumes that collected items are a superset of selected items, hence no need to duplicate the references. And using the node ids to save run state, allows easy lookup inran_item(...)
usage.
_collected_items_by_nodeid: Dict[str, "pytest.Item"] = attr.ib( | ||
factory=dict, init=False | ||
) |
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.
This is generated once at instantiation, and used to easily map selected item nodes to collected pytest items.
## [0.8.4](v0.8.3...v0.8.4) (2020-10-30) ### Performance Improvements * optimise session items data structures ([#403](#403)) ([818d405](818d405))
🎉 This PR is included in version 0.8.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Checklist
Additional Comments
No additional comments.