Sorry for not being clear. myfoo.py is the file with the docstring examples I want to test. foo.py is the file with the modules I need to import.
Let me add that sometimes they're the same file, and it doesn't work in that case either. On Aug 30, 8:08 pm, Robert Bradshaw <[EMAIL PROTECTED]> wrote: > On Aug 30, 2008, at 3:33 PM, David Ketcheson wrote: > > > > > > > I'm developing a package and trying to use sage -t to automatically > > test examples I've put in the docstrings. On the documentation page > > athttp://www.sagemath.org/doc/prog/node29.htmlit says I can do > > something like > > > """ > > EXAMPLES: > > > sage: from foo import * > > """ > > > where foo is not part of Sage. However, supposing the above is in the > > file myfoo.py, if I type > > > sage -t myfoo.py > > > I get the error > > > ********************************************************************** > > File "/Applications/sage/tmp/myfoo.py", line 8: > > sage: from foo import * > > Exception raised: > > Traceback (most recent call last): > > File "/Applications/sage/local/lib/python/doctest.py", line > > 1228, in __run > > compileflags, 1) in test.globs > > File "<doctest __main__.example_0[1]>", line 1, in <module> > > from foo import *###line 8: > > sage: from foo import * > > ImportError: No module named foo > > ********************************************************************** > > > Also, the documentation says a .doctest directory is created and has a > > file .doctest_myfoo.py that I can inspect, but I cannot find any such > > thing. I'd be very grateful for any help. > > If you file is named myfoo.py, you have to do "from myfoo imoprt *" > > - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---