ENH: adding doctest-requires-all directive by bsipocz · Pull Request #280 · scientific-python/pytest-doctestplus

@bsipocz

The need for this came up again recently in astroquery, so finally I got down to do it.

To close #183

pllim

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I wonder if this will also be useful for #279.

Just some minor comments.


Multiple requirements can be specified if separated by semicolons.


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsipocz @pllim

Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>

@bsipocz

Not sure about #279, if anyone wants to dive into it be my guest. But this is very similar to #146, so I'm opening a PR for that, too.

pllim

Comment on lines +453 to +455

This is a narrative line, before another doctest snippet

>>> import foobar

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix formatting to reflect typical real use case.

This is a narrative line, before another doctest snippet
>>> import foobar
This is a narrative line, before another doctest snippet::
>>> import foobar

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not matter, all the snippets should be collected no matter if there are :: or correct number of spaces before the >>>.

@bsipocz

I go ahead and merge this now, so the other PR doesn't have to be rebased.

@bsipocz bsipocz deleted the doctest-requires-all branch

January 24, 2025 01:54