How would I use nose from a python script to
- gather python files from a directory
- foreach file
- run all test classes found using passed parameters
Here's an example, given files
/run.py
/tests/TestClassA.py
and within TestClassA.py is the code
class A():
__init__(self, b):
self._b = b
test_run():
print("%s",self._b)
To restate the need:
I want to call nose from run.py. I want nose (or some part of nose) to
- find class A in file TestClassA.py
- create an instance of A, named a, passing the string "foo" to A.__ init __ function
- call a.test_run()
What is the python nose code within run.py for this request?
If not python nose , would python unittests do any better?