You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add sphinx directive to use +FLOAT_CMP on a block of doctests #2662
#2087 added support for a doctest flag FLOAT_CMP to parse out and compare floating point values as actual floats.
One thing I found in the course of implementing this is that, while FLOAT_CMP should be disabled by default, it is sometimes useful to enable it for a while block of doctests at once.
We've already added a Sphinx directive for marking a whole block of doctests for skipping. What we might consider is extended the existing directive to support setting arbitrary doctest flags. Perhaps a doctest-flags directive :)
This would require some cooperation with astropy-helpers as well since that's where the actual Sphinx directives live.
@kdavies4 You're welcome to propose that to python-ideas. As it is, it works pretty well for a lot of things, but still could use some tweaking, such as some way to control the tolerances.
Activity
kdavies4 commentedon Aug 11, 2014
+FLOAT_CMPis a great feature! Is there an chance that it could be added to the doctest package itself so that other projects can easily use it?embray commentedon Aug 11, 2014
@kdavies4 You're welcome to propose that to python-ideas. As it is, it works pretty well for a lot of things, but still could use some tweaking, such as some way to control the tolerances.
kdavies4 commentedon Aug 11, 2014
@embray, Thanks. I posted that suggestion to python-ideas (https://mail.python.org/pipermail/python-ideas/2014-August/028559.html).
bsipocz commentedon Aug 18, 2014
I would link #2830 here, as a new
doctest-flagsdirective would be very useful to get +REMOTE_DATA on a block of doctests, too.keflavich commentedon Sep 10, 2014
👍 to @bsipocz 's suggestion - is that as easy as adding something like
to this code: https://github.com/astropy/astropy/pull/2087/files#diff-a80b3c301a641a6bdd085a61b194b6a4R18 ? Then I guess you'd need to add a check for
if flags & REMOTE_DATA:that would run the tests as normal if--remote-datawas passed or skip otherwise?bsipocz commentedon Mar 18, 2019
This has been added as a feature request for
pytest-doctestplusin scientific-python/pytest-doctestplus#3, along with a similar directive forREMOTE_DATAin scientific-python/pytest-doctestplus#2.