[Python-Dev] doc tests failing

R. David Murray rdmurray at bitdance.com
Fri Nov 13 10:44:26 EST 2015


We don't have clean doctests for the docs.  Patches welcome.

At one point I had made the turtle doctests pass (it draws a bunch of
stuff on the screen) because otherwise we don't have very many turtle
tests, but I haven't checked it in a couple years.

Hmm.  We could list making the doc doctests pass as an activity for
beginners in the devguide.

On Fri, 13 Nov 2015 07:12:32 -0800, Ethan Furman <ethan at stoneleaf.us> wrote:
> What am I doing wrong?
> 
> I have tried:
> 
> --------------------------------------------------------
> hg update 3.5  # and hg update default
> make distclean && ./configure --with-pydebug && make -j2
> cd Doc
> make doctest
> --------------------------------------------------------
> 
> and in both cases I get page after page of errors.  I have tried 
> installing python-sphinx and python3-sphinx; I have tried adding 
> PYTHON=../python and PYTHON=python3 to the `make doctest` line -- all to 
> no avail.
> 
> Here's a random sample of the errors:
> 
> **********************************************************************
> File "library/shlex.rst", line ?, in default
> Failed example:
>      remote_command
> Exception raised:
>      Traceback (most recent call last):
>        File "/usr/lib/python2.7/doctest.py", line 1315, in __run
>          compileflags, 1) in test.globs
>        File "<doctest default[1]>", line 1, in <module>
>          remote_command
>      NameError: name 'remote_command' is not defined
> 
> **********************************************************************
> File "howto/sorting.rst", line ?, in default
> Failed example:
>      sorted([5, 2, 4, 1, 3], cmp=numeric_compare)
> Exception raised:
>      Traceback (most recent call last):
>        File "/usr/lib/python2.7/doctest.py", line 1315, in __run
>          compileflags, 1) in test.globs
>        File "<doctest default[1]>", line 1, in <module>
>          sorted([5, 2, 4, 1, 3], cmp=numeric_compare)
>      NameError: name 'numeric_compare' is not defined
> 
> **********************************************************************
> File "library/ipaddress.rst", line ?, in default
> Failed example:
>      n2 = ip_network('192.0.2.1/32')
> Exception raised:
>      Traceback (most recent call last):
>        File "/usr/lib/python2.7/doctest.py", line 1315, in __run
>          compileflags, 1) in test.globs
>        File "<doctest default[1]>", line 1, in <module>
>          n2 = ip_network('192.0.2.1/32')
>      NameError: name 'ip_network' is not defined
> 
> --
> ~Ethan~
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/rdmurray%40bitdance.com


More information about the Python-Dev mailing list