Hi all !


I want sage -t to test my docstrings.
Here is my example :


---------- sagess.py ------------


#! /usr/bin/sage -python
# -*- coding: utf8 -*-

from sage.all import *

def my_function(a):
    """

    EXAMPLE ::

    sage: my_function(3)
    6

    """
    return a*2


---------- end of sagess.py ------------

It's failing with :

*********************************************************************

File "/home/moky/script/sagess.py", line 12:
    sage: my_function(3)
Exception raised:
    Traceback (most recent call last):
File "/home/moky/Sage/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
File "/home/moky/Sage/local/bin/sagedoctest.py", line 38, in run_one_example OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags) File "/home/moky/Sage/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_0[2]>", line 1, in <module>
        my_function(Integer(3))###line 12:
    sage: my_function(3)
    NameError: name 'my_function' is not defined


$ sage --version
Sage Version 4.8, Release Date: 2012-01-20

Is it normal ? With older versions of sage the same docstring was working.

Thanks
Laurent

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to