On Wed, Dec 10, 2008 at 2:17 AM, Andy Ray Terrel <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I had a few question trying to use the Sphinx doctest extension.  I
> would like to get some code in a Sphinx generated tutorial to be
> tested for the SymPy project, currently we use the Python doctest
> module to test the code but I have had problems switching over to the
> Sphinx doctest extension.
>
> First, can doctest use non-ASCII characters, I'm getting the error:
> Exception occurred:
>  File "/usr/local/src/sympy/doc/sphinx/Sphinx-0.5/sphinx/application.py",
> line 151, in info
>    self._status.write(message)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u2500' in
> position 163: ordinal not in range(128)
>
>
> Second, I'm having trouble getting the testsetup working for example:
>
> .. _tutorial:
>
> ========
> Tutorial
> ========
>
> .. doctest::
>
>    >>> import sympy
>    >>> a = sympy.Rational(1,2)
>    >>> a
>    1/2
>
>
> works fine but the following fails.
>
> .. _tutorial:
>
> ========
> Tutorial
> ========
>
> .. testsetup::
>   import sympy
>
> .. doctest::
>
>    >>> a = sympy.Rational(1,2)
>    >>> a
>    1/2
>
> with NameError: name 'sympy' is not defined
>
>
> Third there are a lot of things we import that we get from upstream so
> we don't really want to do doctests on lots of them, I suppose we will
> have to look at what the Sphinx documentation is pulling in but is
> there a way to tell doctest not to test certain modules.
>
> Finally, when I run the Sphinx doctest is there a way to do a
> system-wide testsetup that works for more that just one file.
>
> Thanks for any help you can provide.

Generally this is the way to go. Improve our docstring examples, so
that they pass using doctests and then generate the documentation to
sphinx using the autodoc sphinx feature.

Another approach is to write the docs by hand in sphinx and test it,
but then you need to fix all the problems you mentioned above.

Ideally we should use a combination of both.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
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/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to