From 94b152ea2f89655ae88b5b862fba3fd4a4c05575 Mon Sep 17 00:00:00 2001 From: "Jessica B. Hamrick" Date: Mon, 19 May 2014 16:08:21 -0700 Subject: [PATCH] Add the function to its own globals, so recursive functions work --- ipython_doctester.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ipython_doctester.py b/ipython_doctester.py index 60a6738..bf4a5ac 100644 --- a/ipython_doctester.py +++ b/ipython_doctester.py @@ -188,6 +188,7 @@ class NoStudentNameException(IPythonDoctesterException): def testobj(func): + func.func_globals[func.__name__] = func tests = finder.find(func) if (not tests) or (not tests[0].examples): doctest_filename = os.path.join(os.curdir, doctest_path, func.__name__