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
Conversation
…e to show that the test is running
def _docs(): | ||
"""test docstring paramters | ||
using vispy/utils/tests/test_docstring_parameters.py""" | ||
print ("warning: this imports vispy from the vispy installation. it is" |
There was a problem hiding this comment.
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']) |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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!
@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() |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
add test docs option to make.py
@bollu LGTM other than my last comment. We can make that minor tweak in some future PR. |
Thanks for the enhancement, hopefully it makes the other coding easier for you :) |
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
.