Dear doctest framework team,

Let me start by thanking the doctest team for the new framework! Even
just from a speed point of view, it's great.

On Mon, May 06, 2013 at 08:34:43PM -0700, Ben Hutz wrote:
>      Thanks that helped.  Actually, it does appear that four tests are not
>      being run, but I'm not sure why. Is it because the class code is just
>      "pass"?
> 
>      class SchemeMorphism_point_abelian_variety_field\
>              (AdditiveGroupElement, SchemeMorphism_point_projective_field):
>          """
>          A rational point of an abelian variety over a field.

Is there a compelling reason for why the new doctesting insists on
taking indentation into account? And in general in not taking each and
every multiline string in the file as a docstring where to get
doctests from?

I think the above syntax should be supported. Also, I like to be able
to test attributes in classes by prepending a docstring with doctests:

    class blah:
        ...


        """
        TESTS::

            sage: blah.foo
            3
        """
        foo = 3

This is not anymore possible. Finally, with the new global options,
it's natural to feed documentation to the option parser as strings,
and those strings contain examples. We would want them to be tested!
(see sage.combinat.partitions).

This is holding up #2023 and #4327, so a quick answer - if not fix -
would be welcome! A minimal change that would cover partitions,
tableaux and the above patches with minimal workaround would be:

diff --git a/sage/doctest/sources.py b/sage/doctest/sources.py
--- a/sage/doctest/sources.py
+++ b/sage/doctest/sources.py
@@ -967,7 +967,7 @@ class PythonSource(SourceLanguage):
         quotematch = None
         if self.quotetype is None:
             # We're not inside a triple quote
-            if line[indent] != '#' and (indent == 0 or indent > 
self.last_indent):
+            if line[indent] != '#' and (indent == 0 or indent >= 
self.last_indent):


I am happy to make this into a ticket.

Cheers,
                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to