Skip to content
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

Improve doctests - conditional dependency skip #733

Closed
Borda opened this issue Jan 9, 2022 · 3 comments · Fixed by #759
Closed

Improve doctests - conditional dependency skip #733

Borda opened this issue Jan 9, 2022 · 3 comments · Fixed by #759
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed test / CI testing or CI
Milestone

Comments

@Borda
Copy link
Member

Borda commented Jan 9, 2022

🚀 Feature

use conditional skip for doctest which are showing metrics with additional dependency
Thx @ethanwharris for finding this nice pytest extension - pytest-doctestplus
see sample usage: https://github.com/astropy/pytest-doctestplus#doctest-dependencies

Motivation

have all doctests/examples tested again

Pitch

At this moment we are skipping all which are not pure PyTorch so the outputs could be wrong after several changes in codebase

Alternatives

Additional context

@Borda Borda added enhancement New feature or request test / CI testing or CI labels Jan 9, 2022
@Borda Borda added this to the v0.7 milestone Jan 9, 2022
@Borda Borda mentioned this issue Jan 9, 2022
@Borda Borda added good first issue Good for newcomers help wanted Extra attention is needed labels Jan 9, 2022
@ethanwharris
Copy link
Member

ethanwharris commented Jan 10, 2022

This is how we do it in Flash:

# Skip doctests if requirements aren't available
if not _IMAGE_AVAILABLE:
    __doctest_skip__ = ["ImageClassificationData", "ImageClassificationData.*"]

Then enable pytest-doctestplus in setup.cfg with doctest_plus = enabled.

Note: As doctests are not run by sphinx, the .. doctest-requires:: asdf directive won't work

@stancld
Copy link
Contributor

stancld commented Jan 13, 2022

@Borda Is there any help needed to finish v0.7? :]

@Borda
Copy link
Member Author

Borda commented Jan 13, 2022

@Borda Is there any help needed to finish v0.7? :]

It would be nice, but not rush with this one =)

@Borda Borda mentioned this issue Jan 14, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed test / CI testing or CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants