pytest-sphinx icon indicating copy to clipboard operation
pytest-sphinx copied to clipboard

Add support for :skipif:

Open twmr opened this issue 5 years ago • 8 comments

See http://www.sphinx-doc.org/en/master/usage/extensions/doctest.html#skipping-tests-conditionally

  • [x] in testoutput
  • [x] in testcode
  • [ ] in doctest
  • [ ] in testsetup/testcleanup

twmr avatar May 10 '19 10:05 twmr

I need that, too!

dc3671 avatar Apr 01 '20 04:04 dc3671

Before I can continue working on this I need to do some preparations, one of them is to add a test-framework that runs sphinx-build -M doctest. This is needed for making sure that pytest-sphinx treats the doctests the same way as sphinx.

twmr avatar Apr 01 '20 20:04 twmr

I'll soon upload a PR for adding support for :skipif: in `..testoutput``.

@dc3671 In which directives do you want to use :skipif:?

twmr avatar Apr 19 '20 20:04 twmr

@thisch just .. testoutput is fine. Supporting .. testcode is better.

dc3671 avatar Apr 21 '20 09:04 dc3671

I'll probably release a new version of pytest-sphinx containing support for :skipif: in all directives next week.

twmr avatar Apr 21 '20 10:04 twmr

@thisch just .. testoutput is fine. Supporting .. testcode is better.

Done in #21.

twmr avatar Apr 22 '20 21:04 twmr

Hi @thisch, just found my way to this issue and am wondering about the status. I'm specifically interested in "skipif" support for .. doctest. I see this issue is still open and the "in doctest" checkbox in the description is unchecked, but I also see:

On Apr 21, 2020 you wrote:

I'll probably release a new version of pytest-sphinx containing support for :skipif: in all directives next week.

...and there was in fact a new version released a few months later, though https://github.com/thisch/pytest-sphinx/blob/master/CHANGELOG.md#03---2020-08-04 doesn't mention skipif support for .. doctest. So I'm guessing this is still to-do. If so, are you still thinking of getting to this soon?

Thanks for maintaining this package, and looking forward to being able to hopefully use it once this issue is fixed.

jab avatar Feb 06 '22 15:02 jab

Just hit a related issue combining the recommended workaround for #5 with the current :skipif: support.

Mentioning here in case it's worth adding an associated checkbox to this issue's description.

jab avatar Jan 04 '23 05:01 jab