klenwell information services : PythonUnitTesting

Python Unit Tests

return to PythonTesting

Auto-Load All Test Classes in Module

if __name__ == "__main__":
    mod = sys.modules[globals()['__name__']]
    suite = unittest.TestLoader().loadTestsFromModule(mod)
    unittest.TextTestRunner(verbosity=2).run(suite)


References

http://docs.python.org/library/unittest.html