diff options
author | edschofield <edschofield@localhost> | 2007-05-24 18:48:47 +0000 |
---|---|---|
committer | edschofield <edschofield@localhost> | 2007-05-24 18:48:47 +0000 |
commit | de20de7f096fd4b5be726c29b9bb43bb0a092934 (patch) | |
tree | 9718590fca2539e87c0b17eac2d1708a6472bb3c /numpy/testing/numpytest.py | |
parent | 633def1ab34f1ae885deb388904aff075f37438c (diff) | |
download | numpy-de20de7f096fd4b5be726c29b9bb43bb0a092934.tar.gz |
Improve docstring formatting for NumpyTest
Diffstat (limited to 'numpy/testing/numpytest.py')
-rw-r--r-- | numpy/testing/numpytest.py | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py index e8bbac440..da09a830d 100644 --- a/numpy/testing/numpytest.py +++ b/numpy/testing/numpytest.py @@ -239,22 +239,22 @@ class NumpyTest: <package> is package name or its module object. - Package is supposed to contain a directory tests/ - with test_*.py files where * refers to the names of submodules. - See .rename() method to redefine name mapping between test_*.py files - and names of submodules. Pattern test_*.py can be overwritten by - redefining .get_testfile() method. - - test_*.py files are supposed to define a classes, derived - from NumpyTestCase or unittest.TestCase, with methods having - names starting with test or bench or check. The names of TestCase - classes must have a prefix test. This can be overwritten by - redefining .check_testcase_name() method. + Package is supposed to contain a directory tests/ with test_*.py + files where * refers to the names of submodules. See .rename() + method to redefine name mapping between test_*.py files and names of + submodules. Pattern test_*.py can be overwritten by redefining + .get_testfile() method. + + test_*.py files are supposed to define a classes, derived from + NumpyTestCase or unittest.TestCase, with methods having names + starting with test or bench or check. The names of TestCase classes + must have a prefix test. This can be overwritten by redefining + .check_testcase_name() method. And that is it! No need to implement test or test_suite functions in each .py file. - Also old styled test_suite(level=1) hooks are supported. + Old-style test_suite(level=1) hooks are also supported. """ _check_testcase_name = re.compile(r'test.*').match def check_testcase_name(self, name): @@ -293,9 +293,14 @@ class NumpyTest: self._rename_map = {} def rename(self, **kws): - """ Apply renaming submodule test file test_<name>.py to test_<newname>.py. - Usage: self.rename(name='newname') before calling self.test() method. - If 'newname' is None, then no tests will be executed for a given module. + """Apply renaming submodule test file test_<name>.py to + test_<newname>.py. + + Usage: self.rename(name='newname') before calling the + self.test() method. + + If 'newname' is None, then no tests will be executed for a given + module. """ for k,v in kws.items(): self._rename_map[k] = v @@ -533,12 +538,12 @@ class NumpyTest: True --- run all test files (like self.testall()) False (default) --- only run test files associated with a module - It is assumed (when all=False) that package tests suite follows the - following convention: for each package module, there exists file - <packagepath>/tests/test_<modulename>.py that defines TestCase classes - (with names having prefix 'test_') with methods (with names having - prefixes 'check_' or 'bench_'); each of these methods are called when - running unit tests. + It is assumed (when all=False) that package tests suite follows + the following convention: for each package module, there exists + file <packagepath>/tests/test_<modulename>.py that defines + TestCase classes (with names having prefix 'test_') with methods + (with names having prefixes 'check_' or 'bench_'); each of these + methods are called when running unit tests. """ if level is None: # Do nothing. return |