teyit
teyit copied to clipboard
Rewrite `assert` statements, refs #12
This is still a WIP.
I have several questions:
- How does
get_arg_offsetsuppose to work? I am bit a lost with this approach 🙂 - Do we need to handle
msgpart ofassert expr, msg? Because not allself.assert*()methods support it
Closes #12
How does get_arg_offset suppose to work? I am bit a lost with this approach
Yeah, it is not a very straight forward solution. But basically it is for adjusting comments appropriately when the initial version of the same call (e.g assertTrue(a < 10, msg="x") has 2 arguments) has more/less arguments than the refactored version (e.g assertLessEquali(a, 10, msg="x") has 3 arguments).
I don't think it is something that this refactor should worry about. Perhaps try returning 0?
Do we need to handle msg part of assert expr, msg? Because not all self.assert*() methods support it
I guess it serves the same purpose, so we can use it. I don't think we need to add it in this PR.