Skip to content

Parse Inputs from docstring

Compare
Choose a tag to compare
@isidore isidore released this 11 Feb 19:25
· 198 commits to main since this release

This allows for inline approvals to get the inputs from the approved docstring.
(more coming soon)
Here's an example where the inputs (a,b,c) are gathered from the docstring:

from approvaltests.inline.parse_docstring import parse_docstring

def test_uppercase():
    """
    a -> A
    b -> B
    c -> C
    """
    verify("\n".join([ f"{a} -> {a.upper()}" for a in parse_docstring()]), options=Options().inline())