Skip to content
Browse files

DOC: add info on docstrings in test functions/methods. Also fix a typo.

  • Loading branch information...
1 parent 4a2295d commit 675ce72c2e1e11dce69ee8b8c51002e6c757379b @rgommers committed Jul 15, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 doc/TESTS.rst.txt
View
9 doc/TESTS.rst.txt
@@ -116,6 +116,11 @@ Sometimes it is convenient to run ``test_yyy.py`` by itself, so we add
at the bottom.
+Note that ``test_`` functions or methods should not have a docstring, because
@charris
charris added a note Jul 15, 2012

I think this would go better if appended to the earlier paragraph that ends with -O.

@rgommers
Owner
rgommers added a note Jul 15, 2012

OK, I'll move it there and push the commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+that makes it hard to identify the test from the output of running the test
+suite with ``verbose=2`` (or similar verbosity setting). Use plain comments
+(``#``) if necessary.
+
Labeling tests with nose
------------------------
@@ -174,7 +179,7 @@ nose decorators::
@nose.with_setup(setup_func, teardown_func)
def test_with_extras():
- """This test uses the setup/teardown functions."""
+ # This test uses the setup/teardown functions.
global helpful_variable
print " In test_with_extras"
print " Helpful is %s" % helpful_variable
@@ -205,7 +210,7 @@ hard to see for which parameters. To avoid this problem, ensure that:
``test_*`` generator function, but delegated to a corresponding
``check_*`` function (can be inside the generator, to share namespace).
- The generators are used *solely* for loops over parameters.
- - These parameters are *not* arrays.
+ - Those parameters are *not* arrays.
.. warning::

2 comments on commit 675ce72

@charris

Looks like there is some janitorial work to be done, a lot of current tests have docstrings.

@rgommers
Owner

Indeed, but it's not urgent. I'm just cleaning up when I run into some docstrings that are annoying. If they're unique, it's usually still possible to locate the failling test.

Please sign in to comment.
Something went wrong with that request. Please try again.