Hello,

I'm converting some python modules to cython ones. The original
function have doctests which I would obviously like to keep. However,
if I just let them in the pyx file (in def-ed and cpdef-ed functions
docstrings), doctest does not find them.

However, each function doctstring (myfunction.__doc__) seems fine.

Does-it mean that doctest parses the source file instead of using the
docstring from the python runtime? Or am I mistaken?

Any explanation and workaround is welcome !

a simple example is attached. I run it with python  2.6.2 (ubuntu
intrepid). Cython version 0.10.3.

Attachment: hg.pyx
Description: Binary data

import doctest
import hg
doctest.testmod(hg, verbose=True)

print hg.rotx.__doc__
print hg.rotz.__doc__

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

setup(
    cmdclass = {'build_ext': build_ext},
    ext_modules = [Extension("hg", ["hg.pyx"])]
)

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to