Testing ProDy

Running Unittests

The easiest way to run ProDy unit tests is using nose. The following will run all tests:

$ nosetests prody

To skip tests that are slow, use the following:

$ nosetests prody -a '!slow'

To run tests for a specific module do as follows:

$ nosetests prody.tests.atomic prody.tests.sequence

Unittest Development

Unit test development should follow these guidelines:

  1. For comparing Python numerical types and objects, e.g. int, list, tuple, use methods of unittest.TestCase.
  2. For comparing Numpy arrays, use assertions available in numpy.testing module.
  3. All test files should be stored in tests folder in the ProDy package directory, i.e. prody/tests/
  4. All tests for functions and classes in a ProDy module should be in a single test file named after the module, e.g. test_atomic/test_select.py.
  5. Data files for testing should be located in tests/test_datafiles.