Closed ev-br closed 6 months ago
@Sheila-nk WDYT?
Note to self: remember to update https://github.com/scipy/scipy/pull/20127 when this lands.
I think it's great you made the collection strategy configurable. Looks good to me! 🚀
Let's roll with it then. More tweaks are on the way based on the combination of this and gh-133. Thanks Sheila.
Did not mean to squash-merge. Not a big deal though.
This is a breaking change: the default collection strategy changes from "api" to vanilla pytest.
Add a cmdline option,
--doctest-collect={None, api}
The default is now the vanilla doctest collection,
strategy=None
. To selectstrategy='api'
, use the command flagWhen to use what. strategy='api' is meant for packages with non-trivial internal structure and where you only enfore doctests correctness for public objects.
For individual single-file modules, you probably want strategy=None.
closes gh-114
P.S. I manually checked
pytest --doctest-modules <path-to-build-install>/scipy/linalg/_basic.py --collect-only
gives$ python dev.py test --doctests -t scipy/linalg/_basic.py::scipy.linalg._basic.det -v -- --collect-only
producesNote the need to specify the full dotted name of the doctested object.