Skip to content
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

Auto-ignore lines calling the exception test function in Otter Assign #516

Open
chrispyles opened this issue Aug 24, 2022 · 1 comment
Open
Labels
enhancement New feature or request
Milestone

Comments

@chrispyles
Copy link
Member

For exception tests in Otter Assign, test cells are formatted like

def test(var):
    # some logic

test(var) # IGNORE

Needing to remember the # IGNORE comment is cumbersome. Since each cell should have only 1 test in it, we can parse the cell and remove all lines outside the function body.

@chrispyles chrispyles added the enhancement New feature or request label Aug 24, 2022
@chrispyles chrispyles added this to the v4.1.0 milestone Aug 24, 2022
@chrispyles chrispyles removed this from the v4.1.0 milestone Oct 9, 2022
@chrispyles
Copy link
Member Author

This can probably be done by parsing the cell's source as an AST, removing all nodes except the first def node, and using astunparse to convert this back to Python code.

@chrispyles chrispyles added this to the v6.0.0 milestone Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant