New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document the autotestdict directive (#387) #950
Comments
@dagss changed summary from Document the doctest hack directive (http://trac.cython.org/ticket/387) to Document the autotestdict directive (http://trac.cython.org/ticket/387) |
I was going to open an issue about this as well. I was recently bitten by this because working with the pytest-cython plugin this actually causes every test to be run twice. It's actually a pretty nice feature of Cython and it would be worth incorporating explicit support for it into pytest-cython, but in the meantime I needed to find a way to disable it, and since it's not documented it was a bit mysterious at first. I'll make a PR for it if you want. Just wasn't sure until I found this issue if there was an explicit reason it was an undocumented feature. |
Yes, a PR would be appreciated. |
it results in each test being run twice. It's actually a nice feature that could and should be integrated into pytest-cython; e.g. it gives better reporting of *where* in the .pyx files the tests are (what lines). But for now it's a hindrance. See also cython/cython#950
I'm actually trying to better understand exactly what problem this feature was intended to solve and how it's expected to work? At least in current versions of Cython, unless compiling with docstrings stripped out, for functions accessible from Python this isn't entirely needed because their doctests can still be introspected from the Python level. To me, this seems most useful for docstrings that would not otherwise be accessible from Python, such as for @dagss Do you have any idea? |
Lines 901 to 902 in 5d7d0db
I think it's necessary to make the doctests work on earlier versions of Python. Doctests definitely don't work for Python 2.7 without it (but I don't know the exact mechanism that the doctest module uses). For more recent versions it's probably pretty unnecessary. |
Should we remove the feature in 3.1 then?
|
I don't see why it should be on by default there. Potentially Probably remove it unless |
One reason I was looking into this is thinking about the possibility of switching SageMath to using pytest as its test runner. For that, being able to document cdef functions would be useful (I agree that in most cases cdef functions are still tested implicitly by tests for wrapper code, but Sage still has tons of doctests in cdef functions for historic reasons). However, I found that there is no combination of settings that allow creating a |
Document the functionality implemented in http://trac.cython.org/ticket/387.
Migrated from http://trac.cython.org/ticket/388
The text was updated successfully, but these errors were encountered: