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.
-- Andy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---