Changes between Version 8 and Version 9 of TestingGuidelines
- Timestamp:
- 01/15/07 02:03:13 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TestingGuidelines
v8 v9 5 5 6 6 Our goal is that every module and package in !SciPy includes a thorough set of unit tests. These tests should exercise the functionality of a routine as well as its robustness to erroneous or unexpected input arguments. The best time to write the tests is when the module itself is being written. Whenever a new bug is found in a routine, a unit test should be written to test for the error so that it can't creep back in unnoticed after future code changes. 7 8 Much of !SciPy is legacy code that was written without unit tests. As such, much of the functionality remains untested. However, more unit tests are being written all the time (and we encourage you to contribute). If you are writing a package that you'd like to become part of !SciPy, please write the tests as you develop the package.9 7 10 8 == Running !SciPy's test suite == … … 20 18 21 19 === Levels and verbosity === 20 The test method may takes two arguments; the first specifies the level of testing and the second the verbosity: 21 {{{ 22 >>> scipy.test(level=1, verbosity=2) 23 }}} 24 The test level can be varied from 1 to 10. Increasing the verbosity provides more detailed messages about what tests are being executed. 25 {{{ 26 level: 27 None --- do nothing, return None 28 < 0 --- scan for tests of level=abs(level), 29 don't run them, return TestSuite-list 30 > 0 --- scan for tests of level, run them, 31 return TestRunner 32 33 verbosity: 34 >= 0 --- show information messages 35 > 1 --- show warnings on missing tests 36 }}} 22 37 23 38 == Writing your own tests == 39 Much of !SciPy is legacy code that was written without unit tests. As such, much of the functionality remains untested. However, more unit tests are being written all the time (and we encourage you to contribute). If you are writing a package that you'd like to become part of !SciPy, please write the tests as you develop the package. 24 40 25 41 === Setting up a module for testing ===
