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

add test docs option to make.py #995

Merged
merged 8 commits into from Jun 21, 2015
Merged

Conversation

bollu
Copy link
Contributor

@bollu bollu commented Jun 20, 2015

closes #993

Also added an option to the makefile so you can write make docs.

the syntax to invoke this test is python make.py test docs.

def _docs():
"""test docstring paramters
using vispy/utils/tests/test_docstring_parameters.py"""
print ("warning: this imports vispy from the vispy installation. it is"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not super happy with the solution. Is there a way to ensure that the newest versions are automatically tested? This was the simplest solution I could come up with (i.e, import the test from the vispy install), but I think there's a better solution that I'm missing

@@ -344,6 +363,9 @@ def test(label='full', extra_arg_string='', coverage=False):
runs.append([_check_line_endings, 'lineendings'])
if label in ('full', 'extra', 'flake'):
runs.append([_flake, 'flake'])
if label in ('full', 'extra', 'docs'):
runs.append([_docs, 'docs'])
Copy link
Member

Choose a reason for hiding this comment

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

not for full, full already runs it as part of nosetests

" Vispy's installation. It is"
" recommended to setup Vispy using"
" 'python setup.py develop'"
" so that the latest sources are used automatically")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@QuLogic: fixed the capitalization :) Sorry for that!

@bollu
Copy link
Contributor Author

bollu commented Jun 21, 2015

@Eric89GXL: Is this merge-able?

# this should always be importable
from vispy.util.tests import test_docstring_parameters
print("Running docstring test...")
test_docstring_parameters.test_docstring_parameters()
Copy link
Member

Choose a reason for hiding this comment

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

It is best/clearest to put as few lines as possible in the try. So that would be the actual function call. Also, you can use a relative import here like from ..util.tests import test_docstring_parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, thanks for the tips on try/catch. That makes a lot of sense! Will keep that in mind for the future.

larsoner added a commit that referenced this pull request Jun 21, 2015
@larsoner larsoner merged commit 6096670 into vispy:master Jun 21, 2015
@larsoner
Copy link
Member

@bollu LGTM other than my last comment. We can make that minor tweak in some future PR.

@larsoner
Copy link
Member

Thanks for the enhancement, hopefully it makes the other coding easier for you :)

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.

Allow make.py test flake to run docstring tests as well
3 participants