I have a fairly complex system that I want to test using python. My test code will interact with the system using a Python module I've already written. There are a few things however, that I haven't been able to figure out, regarding the testing framework. I haven't selected one yet, but obviously I feel directed to unittest
.
Passing parameters to the tests. I need to pass a specific ID to many different parts of my test code, depending on which component of the system I am testing. Does unittest provide for this? In other words, right now I just have a test script, which I run like this:
./testscript.py 123 win 32
How can I pass the same parameters similarly in a testing framework?unittest
provides forsetUp()
andtearDown()
methods, but they are called before/after each test method. How can I have functions that are called before/after the entire battery of tests in aTestCase
?
Maybe unittest
is not what I actually want to use?