On Tue, Feb 14, 2017 at 4:32 PM, Michael Orlitzky <[email protected]> wrote:
> On 02/14/2017 10:19 AM, Erik Bray wrote:
>>
>> Add explicit imports to the test, for example:
>>
>>       TESTS::
>>
>>           sage: from foo import foo
>>           sage: foo()
>>           True
>
> Same error: name 'foo' is not defined

If you have a package layout like:

    foo/
        __init__.py
        foo.py

where __init__.py is *empty*, then the import statement would actually
have to be:

from foo.foo import foo

Also this depends on how you're running the tests.  If I run:

sage -t /path/to/foo

then it seems I also have to specify PYTHONPATH=/path/to
if 'foo' is not in a default sys.path entry.

-- 
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