def test_func_source_builtin_human(fn): exp = "Evaluate the given source in the context of globals and locals." got = base.func_source(fn, human=1) assert got == exp
def test_func_source_method(fn): exp = "def foo(self):\n pass" assert base.func_source(fn, human=1).strip() == exp
def test_func_source_builtin_id(fn): exp = str(eval) got = base.func_source(fn, human=0) assert got == exp
def test_func_source_func(fn): exp = "def _foo():\n pass" assert base.func_source(fn, human=1).strip() == exp