Skip to content

Testing Directives

Akshay Subramaniam edited this page Jul 27, 2017 · 3 revisions

Testing is absolutely necessary!

For every module module_name.py, write a corresponding test class TestModuleName in a tests/test_module_name.py file using the unittest package. For tests that have to be run in parallel using mpi4py, name the test file tests/mpitest_module_name.py. This then allows automated testing using ./floatpy/tests/runtests.sh from the project directory

  • Write one test file for each module you write
  • Use long and descriptive names for each test
  • Try not to make tests that take a long time to run
  • If data is needed for your test, put it in tests/test_module_name_data/
  • Make sure the data for your test is small (< 1MB in total)