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
> at http://www.sagemath.org/doc/prog/node29.html it 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to