Beispiel #1
0
def test_get_source():
    def fn():
        x = 1

    source = '''
def fn():
    x = 1
    '''

    assert get_source(fn).strip() == source.strip()
Beispiel #2
0
 def as_ast(fn):
     return ast.parse(get_source(fn))
Beispiel #3
0
 def as_str(fn):
     return get_source(fn).strip()