diff --git a/modules/base/tests/test_log.py b/modules/base/tests/test_log.py index 9b6952c912dc28f6252360ea8c5e9f5a4879b189..cec9378edc965174e460c392ee8bf28a69d106e8 100644 --- a/modules/base/tests/test_log.py +++ b/modules/base/tests/test_log.py @@ -39,7 +39,5 @@ class TestLog(unittest.TestCase): self.assertEqual(ls.severity, 1) ost.PopLogSink() if __name__ == "__main__": - try: - unittest.main() - except Exception, e: - print e \ No newline at end of file + from ost import testutils + testutils.RunTests() \ No newline at end of file diff --git a/modules/base/tests/test_stutil.py b/modules/base/tests/test_stutil.py index 6cc4570b5605b5eb47c7507e0d0aa7f942f66496..7d5b9f98f9790db63846bfaa934fafa7de1d891b 100644 --- a/modules/base/tests/test_stutil.py +++ b/modules/base/tests/test_stutil.py @@ -86,7 +86,5 @@ class TestStUtils(unittest.TestCase): (stutil.Correl(self.data3, self.data2), self.correl2) if __name__ == "__main__": - try: - unittest.main() - except Exception, e: - print e \ No newline at end of file + from ost import testutils + testutils.RunTests() \ No newline at end of file diff --git a/modules/base/tests/test_table.py b/modules/base/tests/test_table.py index f2d0280676e05bbe18a7eec4f671b9419641bebe..270780a16446fc8785b36242f3b37213c70e234d 100644 --- a/modules/base/tests/test_table.py +++ b/modules/base/tests/test_table.py @@ -40,7 +40,7 @@ except ImportError: print "Could not find python imagine library: ignoring some table class unit tests" class TestTable(unittest.TestCase): - + def setUp(self): ost.PushVerbosityLevel(3) @@ -1289,7 +1289,5 @@ class TestTable(unittest.TestCase): self.assertAlmostEquals(tab.SpearmanCorrel('second','third'), -0.316227766) if __name__ == "__main__": - try: - unittest.main() - except Exception, e: - print e + from ost import testutils + testutils.RunTests() diff --git a/modules/bindings/tests/test_blast.py b/modules/bindings/tests/test_blast.py index e8e151a4ec4a325658df4cee69c4b8d0b30feb47..8b4215faa45d71660a7799f3211885f519745a56 100644 --- a/modules/bindings/tests/test_blast.py +++ b/modules/bindings/tests/test_blast.py @@ -44,7 +44,5 @@ if __name__ == "__main__": except(settings.FileNotFound): print "Could not find blastall executable: ignoring unit tests" sys.exit(0) - try: - unittest.main() - except Exception, e: - print e + from ost import testutils + testutils.RunTests() diff --git a/modules/bindings/tests/test_clustalw.py b/modules/bindings/tests/test_clustalw.py index 0fdb040db2b59f1a1a216a520059fb9d0f3faada..fa5a5e6b5eb44cbe11a0a11a68dc93d7d64cf123 100644 --- a/modules/bindings/tests/test_clustalw.py +++ b/modules/bindings/tests/test_clustalw.py @@ -68,7 +68,5 @@ if __name__ == "__main__": except(settings.FileNotFound): print "Could not find clustalw executable: ignoring unit tests" sys.exit(0) - try: - unittest.main() - except Exception, e: - print e + from ost import testutils + testutils.RunTests() diff --git a/modules/bindings/tests/test_msms.py b/modules/bindings/tests/test_msms.py index 054a63cffa472d01fbef5d5cd20289cd0a409fb6..9041f94fab817441da03ae794fe63d793ad7d208 100755 --- a/modules/bindings/tests/test_msms.py +++ b/modules/bindings/tests/test_msms.py @@ -42,7 +42,5 @@ if __name__ == "__main__": version = msms.GetVersion(msms_exe=None, msms_env='MSMSSERVER') if version!=VERSION_REQUIRED: print "MSMS version (%s) does not match required version %s: ignoring unit tests"%(version, VERSION_REQUIRED) - try: - unittest.main() - except Exception, e: - print e + from ost import testutils + testutils.RunTests() diff --git a/modules/conop/tests/test_cleanup.py b/modules/conop/tests/test_cleanup.py index ee6ab57cae413a550e1cc6abdbc7875a1d7d3210..1dc280f4fbaac9867c7f7a1063217bb4527cfbd0 100644 --- a/modules/conop/tests/test_cleanup.py +++ b/modules/conop/tests/test_cleanup.py @@ -158,5 +158,7 @@ class TestCleanUp(unittest.TestCase): if not hasattr(conop.GetBuilder(), 'compound_lib'): print 'Default builder without compound lib. Ignoring test_cleanup.py tests' sys.exit() -suite = unittest.TestLoader().loadTestsFromTestCase(TestCleanUp) -unittest.TextTestRunner().run(suite) + +if __name__== '__main__': + from ost import testutils + testutils.RunTests() diff --git a/modules/conop/tests/test_compound.py b/modules/conop/tests/test_compound.py index 2c57bce756e0f26deab7e69467807993e96c51aa..a215a78f7a5dd966c2619346aaabf0f084b7bbd7 100644 --- a/modules/conop/tests/test_compound.py +++ b/modules/conop/tests/test_compound.py @@ -26,6 +26,6 @@ if __name__=='__main__': if not hasattr(builder, 'compound_lib'): print 'default builder does not use compound library. ignoring unit tests' else: - suite = unittest.TestLoader().loadTestsFromTestCase(TestCompound) - unittest.TextTestRunner().run(suite) + from ost import testutils + testutils.RunTests() diff --git a/modules/conop/tests/test_nonstandard.py b/modules/conop/tests/test_nonstandard.py index 57de3864e87575ffde1c7bdd705b5549f488fa31..170749c6eacd73bc64f4b6826e4df5d80f104512 100644 --- a/modules/conop/tests/test_nonstandard.py +++ b/modules/conop/tests/test_nonstandard.py @@ -121,7 +121,7 @@ if __name__ == "__main__": if not hasattr(builder, 'compound_lib'): print 'default builder does not use compound library. ignoring unit tests' else: - suite = unittest.TestLoader().loadTestsFromTestCase(TestNonStandard) - unittest.TextTestRunner().run(suite) + from ost import testutils + testutils.RunTests() diff --git a/modules/geom/tests/test_geom.py b/modules/geom/tests/test_geom.py index e25081bf1f0f305cf7928bd897566ade46c9c9e3..f563add91955b88fcc383b714df2f472a1a9b64e 100644 --- a/modules/geom/tests/test_geom.py +++ b/modules/geom/tests/test_geom.py @@ -80,5 +80,6 @@ class TestGeom(unittest.TestCase): 13,14,15,16]) if __name__== '__main__': - unittest.main() + from ost import testutils + testutils.RunTests() diff --git a/modules/gfx/tests/test_gfx.py b/modules/gfx/tests/test_gfx.py index 0ddeeab7e2961fd9187f7e7bb9414ab8191c1a0a..ffca3b507ebbc6dfc8fe3d50c1701af75d0f0574 100644 --- a/modules/gfx/tests/test_gfx.py +++ b/modules/gfx/tests/test_gfx.py @@ -132,5 +132,6 @@ class TestGfx(unittest.TestCase): if __name__== '__main__': - unittest.main() + from ost import testutils + testutils.RunTests() diff --git a/modules/io/tests/test_io_mmcif.py b/modules/io/tests/test_io_mmcif.py index 82c0be2e818eb7a9665da2002e32f730aee9c2c8..2a137b13b02d125043590ebfa7c268549bb150f7 100644 --- a/modules/io/tests/test_io_mmcif.py +++ b/modules/io/tests/test_io_mmcif.py @@ -155,6 +155,7 @@ class TestMMCifInfo(unittest.TestCase): self.assertEquals(i.GetObsoleteInfo().GetReplacedPDBID(), '2BAR') if __name__== '__main__': - unittest.main() + from ost import testutils + testutils.RunTests() diff --git a/modules/io/tests/test_io_pdb.py b/modules/io/tests/test_io_pdb.py index c8bb3902dbd45b1fb08aea68b81982662d3178a1..873a91e155c3ea64b37623881f1ef8e4aeec177c 100644 --- a/modules/io/tests/test_io_pdb.py +++ b/modules/io/tests/test_io_pdb.py @@ -12,6 +12,7 @@ class TestPDB(unittest.TestCase): self.assertEquals(ch.GetIntProp("mol_id"), 1) if __name__== '__main__': - unittest.main() + from ost import testutils + testutils.RunTests() diff --git a/modules/mol/alg/tests/test_convenient_superpose.py b/modules/mol/alg/tests/test_convenient_superpose.py index 7e03558c06647705589200688fb313df909e5c5b..eb4331ca3e8e6b65b0201197e5755cb2e5fcab15 100644 --- a/modules/mol/alg/tests/test_convenient_superpose.py +++ b/modules/mol/alg/tests/test_convenient_superpose.py @@ -193,4 +193,5 @@ class TestConvenientSuperpose(unittest.TestCase): self.assertEqualAtomOrder(view1, view2) if __name__ == "__main__": - unittest.main() + from ost import testutils + testutils.RunTests() diff --git a/modules/seq/alg/tests/test_aligntoseqres.py b/modules/seq/alg/tests/test_aligntoseqres.py index f31ff9ffa044ee25bdeff10ff11a30e33fbf1720..0f4b8ceaa9bdbdf61bec7a390127b6ebc6687f89 100644 --- a/modules/seq/alg/tests/test_aligntoseqres.py +++ b/modules/seq/alg/tests/test_aligntoseqres.py @@ -68,7 +68,5 @@ class TestAlignToSeqRes(unittest.TestCase): self.assertEqual(seq.alg.ValidateSEQRESAlignment(seqres_aln, chain), False) if __name__ == "__main__": - try: - unittest.main() - except Exception, e: - print e + from ost import testutils + testutils.RunTests() diff --git a/modules/seq/alg/tests/test_global_align.py b/modules/seq/alg/tests/test_global_align.py index aed51741b8ef35f0afdbd02b250cc93ea1c05f23..b23503cd02c2fbd9684a4355cbb14e7e53120a02 100644 --- a/modules/seq/alg/tests/test_global_align.py +++ b/modules/seq/alg/tests/test_global_align.py @@ -44,7 +44,5 @@ class TestGlobalAlign(unittest.TestCase): self.assertEqual(alns[0].sequences[1].offset, 0) if __name__ == "__main__": - try: - unittest.main() - except Exception, e: - print e + from ost import testutils + testutils.RunTests() diff --git a/modules/seq/alg/tests/test_local_align.py b/modules/seq/alg/tests/test_local_align.py index ff6872f9df22b261947e9abdbda12319e22a6d5a..47f78f68668e17e7413cbd18bbf09f9dd94b0b46 100644 --- a/modules/seq/alg/tests/test_local_align.py +++ b/modules/seq/alg/tests/test_local_align.py @@ -43,7 +43,5 @@ class TestLocalAlign(unittest.TestCase): self.assertEqual(alns[0].sequences[1].offset, 2) if __name__ == "__main__": - try: - unittest.main() - except Exception, e: - print e + from ost import testutils + testutils.RunTests() diff --git a/modules/seq/alg/tests/test_renumber.py b/modules/seq/alg/tests/test_renumber.py index 76a9bf1d1d37284914ff7f23f2d32923c451d4f4..51e4727d3cfb7b3f87fea3517f9664fe7c896b16 100644 --- a/modules/seq/alg/tests/test_renumber.py +++ b/modules/seq/alg/tests/test_renumber.py @@ -118,7 +118,5 @@ if __name__ == "__main__": except(settings.FileNotFound): print "Could not find clustalw executable: ignoring unit tests" sys.exit(0) - try: - unittest.main() - except Exception, e: - print e + from ost import testutils + testutils.RunTests() diff --git a/modules/seq/alg/tests/test_weight_matrix.py b/modules/seq/alg/tests/test_weight_matrix.py index 7d85996fb3e74d0aa3ee87eace30a04881b0918a..91cf830379b7e7a3dccb5de3694267497f4d480f 100644 --- a/modules/seq/alg/tests/test_weight_matrix.py +++ b/modules/seq/alg/tests/test_weight_matrix.py @@ -39,7 +39,5 @@ class TestWeightMatrix(unittest.TestCase): self.assertEqual(mat.GetWeight('?', 'E'), 0) if __name__ == "__main__": - try: - unittest.main() - except Exception, e: - print e + from ost import testutils + testutils.RunTests() diff --git a/modules/seq/base/tests/test_seq.py b/modules/seq/base/tests/test_seq.py index 7cc73a5cedb9cad4044948f840693b63bc72b16b..bfd80d7bf70461211962f6b36c2c603584b4fe4c 100644 --- a/modules/seq/base/tests/test_seq.py +++ b/modules/seq/base/tests/test_seq.py @@ -174,6 +174,8 @@ class TestSeq(unittest.TestCase): string_b=''.join([r.one_letter_code for r in b.residues]) self.assertEqual(string_a, 'BDFH') self.assertEqual(string_b, 'BDFH') -suite = unittest.TestLoader().loadTestsFromTestCase(TestSeq) -unittest.TextTestRunner().run(suite) + +if __name__== '__main__': + from ost import testutils + testutils.RunTests()