Closed cjosey closed 7 years ago
Have you looked at using unittest.TestSuite for creating different test suites?
I have addressed most of the issues, as well as added a test runner (test.py in the root directory). It allows for different test suites. I would use nose
, but nobody supports nose
anymore and they're recommending new projects not use it. nose2
, its "successor" isn't available in a lot of default repositories.
This addition adds a mostly complete test suite for opendeplete. It includes unit tests for the more easily unit-testable portions of the code, integral tests for the integrator routines (using a simple, statistics-free test problem), and a full system test to ensure that all components work in concert.
This is the first time I've written tests for a big code like this, so comments strongly encouraged.
Test suite can be run by executing in the opendeplete directory. It took roughly 25 seconds on my computer.
To get only the short tests, skipping over the full system test, run
These shorter tests will take roughly 0.3 seconds.
I would like to find a way to make different test suites without using a fully custom implementation like OpenMC does. I am yet unsure how to do that.
Currently missing tests are for function.py, openmc_wrapper.py, and utilities.py. The first two are due to the fact that, during testing, I realized I needed to rewrite these. Utilities is mostly due to not wanting to hardcode several results objects to test it out.