summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2012-07-15 18:01:13 +0200
committerRalf Gommers <ralf.gommers@googlemail.com>2012-07-15 19:25:58 +0200
commit4d371699a957b3f5c306ee0f5b8c2548c49338e5 (patch)
tree0949a5dede0f0f847351864ba637f1635ebfa44f
parent4a2295d09d76b5e3eeeb62bc6d8f384a81af27d5 (diff)
downloadnumpy-4d371699a957b3f5c306ee0f5b8c2548c49338e5.tar.gz
DOC: add info on docstrings in test functions/methods. Also fix a typo.
Reviewed by @charris in combination with PR-358.
-rw-r--r--doc/TESTS.rst.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/doc/TESTS.rst.txt b/doc/TESTS.rst.txt
index 8f8da8c18..92f236f5a 100644
--- a/doc/TESTS.rst.txt
+++ b/doc/TESTS.rst.txt
@@ -107,6 +107,11 @@ whether a certain assumption is valid. If the assertion fails, the test fails.
Note that the Python builtin ``assert`` should not be used, because it is
stripped during compilation with ``-O``.
+Note that ``test_`` functions or methods should not have a docstring, because
+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.
+
Sometimes it is convenient to run ``test_yyy.py`` by itself, so we add
::
@@ -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::