I ran into an issue regarding sage doctests. Once I don't test individual files, but make a package things go south. From what I understand testing packages requires to add import statements to the doctests, but I cannot make it work.
I have a folder example with two files: An empty __init__.py and an example.py with the following code:
def square(n):
r"""
EXAMPLES::
sage: from example.example import square
sage: square(2)
4
"""
return n**2
I then run "sage -t example/" and get "ImportError: No module named example.example". I wonder how to resolve this and what the intended way of testing external packages with doctests is? Copying the example folder into the $SAGE_ROOT/src/bin/ makes things works, but obviously that's not a real solution. I also tried "sage -t --force_lib example/", but not difference.
Thanks!
Benjamin