On Tue, Feb 14, 2017 at 3:54 PM, Michael Orlitzky <[email protected]> wrote:
> Can someone please give me a hint as to how to fix all of the doctests
> affected by https://trac.sagemath.org/ticket/20729?
>
> Here's an example:
>
>   $ cat foo.py
>   from sage.all import *
>
>   def foo():
>       """
>       Returns ``True``.
>
>       TESTS::
>
>           sage: foo()
>           True
>
>       """
>       return True
>
> That works great in an empty directory:
>
>   $ sage -t foo.py
>   ...
>   ----------------------------------------------------------------------
>   All tests passed!
>   ----------------------------------------------------------------------
>
>
> Now I can ruin everything by doing...
>
>   $ touch __init__.py
>   $ sage -t foo.py
>   ...
>   NameError: name 'foo' is not defined
>
>
> I have a few thousand failing doctests like that where I can't simply
> remove the __init__.py file.

Add explicit imports to the test, for example:

      TESTS::

          sage: from foo import foo
          sage: foo()
          True

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to