pytest-inline
pytest-inline copied to clipboard
Constructor Refactor
(Note: this is a duplicate of a previous pull request. Repo was unliked and reforked to remove undesired changes from original fork.)
Inline Test constructor has been refactored to improve efficiency:
- If-else tree replaced with enums and dictionaries
- Some conditions reordered to remove unnecessary checks (such as distinguishing between a constant and a list)
- Keyword and positional arguments are now both parsed through single helper function. Furthermore, helper functional automatically handles discrepancies between data types for pre-3.7 and v >= 3.8 modules.
- Initial tests show that updated constructor performs as well as previous version (avg execution time of 8.43 for test-plugin.py). However, new constructor would have performed better (avg of 8.35 s) if not for outlier on first testing attempt (8.86 s).