import os import unittest import traceback old=unittest.loader._make_failed_load_tests def patched(a, b, c): traceback.print_exc() return old(a, b, c) unittest.loader._make_failed_load_tests = patched def load_tests(loader, standard_tests, pattern='test*.py'): this_dir = os.path.dirname(__file__) print('load_tests: pattern=%r' % (pattern,)) package_tests = loader.discover(start_dir=this_dir, pattern=pattern) standard_tests.addTests(package_tests) return standard_tests if __name__ == "__main__": unittest.main()