Hi,

Dag Sverre Seljebotn wrote:
> 1) What's the best way to integrate my unit tests for auto-running?

We use a unit test runner script in lxml:

http://codespeak.net/svn/lxml/trunk/test.py

It's even Py3 clean by now (although that currently doesn't matter to Cython
unit tests...). :)


> 2) Robert recently pointed out a bug in my code which was only present 
> when Options.embed_pos_in_docstring was set to 1. Therefore, runtests.py 
> did not catch it.

I thought about this issue, too, but didn't get around to work on it.
Currently, there is no way to specify compiler options from inside a test case.

Also, note that Cython.Compiler.Options is a global thing, so you'd have to
reset the options after running the test. Calling dict(vars(Options)) in
setUp() and resetting all attributes in tearDown() should take care of that,
though.

Something like

    __doc__ = u"""
    ...
    """

    def test(): ...

    _COMPILER_OPTIONS=u"""
    embed_pos_in_docstring = 1
    """

could be handled the same way _ERRORS is currently special cased.


> (Of course, any implementation burden would fall on me, 

Of cause. :)

Stefan

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

Reply via email to