Python unit-testing with nose: Making sequential tests
- by cool-RR
I am just learning how to do unit-testing. I'm on Python / nose / Wing IDE.
(The project that I'm writing tests for is a simulations framework, and among other things it lets you run simulations both synchronously and asynchronously, and the results of the simulation should be the same in both.)
The thing is, I want some of my tests to use simulation results that were created in other tests. For example, synchronous_test calculates a certain simulation in synchronous mode, but then I want to calculate it in asynchronous mode, and check that the results came out the same.
How do I structure this? Do I put them all in one test function, or make a separate asynchronous_test? Do I pass these objects from one test function to another?
Also, keep in mind that all these tests will run through a test generator, so I can do the tests for each of the simulation packages included with my program.