Yes, you can go that route. But since it appears that what you are doing is unit testing related, and you are interested in aranging for all of your unit test cases to be run automatically, I'd suggest using the unittest module.
-- http://mail.python.org/mailman/listinfo/python-list