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

ENH: Add doctest_skip_parser allowing conditional skipping of doctests #821

Merged

Conversation

JDWarner
Copy link
Contributor

This framework is based on a DiPy pull request: dipy/dipy#105

Our first conditional doctests are needed if neither PyQt nor PySide were available in skimage.viewer, reported by @cdeil. However, both instances were actually class docstrings rather than function docstrings, which was not supported by the DiPy decorator.

Here I have generalized the framework slightly (along with updated tests for both classes and functions) and it appears now to work transparently for either case.

I believe this resolves the problem noted after the merge of #811, but @cdeil should test this to make sure.

@ahojnnes, @stefanv and other devs might want to check over current and future skipped doctests; some can probably be converted into conditionals rather than outright skips.

@JDWarner
Copy link
Contributor Author

I believe Travis is hanging because we try to fool it into thinking it has some form of Qt when it does not.

Thus the qt_api is incorrectly reported and these tests are run instead of skipped. This won't happen on any production system (test it for yourself).

Perhaps we need to fool Travis in a different way?

@ahojnnes
Copy link
Member

@JDWarner Hm... Qt is actually installed and working on Travis, but I think the show command freezes until the window is closed?

@JDWarner
Copy link
Contributor Author

@ahojnnes of course...

Should work now.

@stefanv
Copy link
Member

stefanv commented Nov 20, 2013

Can't a person have a condition for the entire test?

@JDWarner
Copy link
Contributor Author

I believe doctests just don't support skipping blocks. There was some discussion about this around #811.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling beb395a on JDWarner:add_conditional_doctest_decorator into f8b5550 on scikit-image:master.

@ahojnnes
Copy link
Member

Perfect, thanks Josh!

ahojnnes added a commit that referenced this pull request Nov 25, 2013
ENH: Add `doctest_skip_parser` allowing conditional skipping of doctests
@ahojnnes ahojnnes merged commit 86c90a3 into scikit-image:master Nov 25, 2013
@ahojnnes
Copy link
Member

@stefanv skipping entire blocks is not possible and the python devs decided that this feature is not wanted: http://bugs.python.org/issue9017

@JDWarner
Copy link
Contributor Author

@cdeil Can you confirm this resolves the issue lingering after #811?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants