PyUnit and multiple test scripts

Calvin Spealman calvin at ironfroggy.com
Sat Feb 26 18:06:16 EST 2005


I'm trying to find the best way to use PyUnit and organize my test scripts.
What I really want is to separate all my tests into 'test' directories
within each module of my project. I want all the files there to define a
'suite' callable and to then all all those suites from all those test
directories into one big suite and run it all. I'm having trouble with
this.

My first barrier was just loading the modules. As I had to be able to find
them automatically (would be tedious to maintain a manual list of them) I
needed to then load the modules from the paths to the files after I found
them. This wasn't working, I just couldn't get it to load. I couldn't
understand the imp module correctly.

1) Is there a very simple way to just take a file path and name, that I
could use to open the source file, and load it as a module object, no
strings attached?

2) Is there already a framework around that will do what I need?

I've tried py.test, but I really do not like the way it displays results.




More information about the Python-list mailing list