diff --git a/scripts/gen_individual_importing_tests.py b/scripts/gen_individual_importing_tests.py index 946d1704..81b3201f 100644 --- a/scripts/gen_individual_importing_tests.py +++ b/scripts/gen_individual_importing_tests.py @@ -223,7 +223,9 @@ for ver in [2, 3]: open(os.path.join(".", "tests", "unit-generated", 'test__%s__v%d.py' % (mod, ver) ), 'w').write('''#!/usr/bin/env python%(ver)d -from %(mod)s import mymain - -mymain() +import unittest +from %(mod)s import MyTests +from pycotap import TAPTestRunner +suite = unittest.TestLoader().loadTestsFromTestCase(MyTests) +TAPTestRunner().run(suite) ''' % {'mod': mod, 'ver': ver}) diff --git a/tests/lib/pysol_tests/acard_unit.py b/tests/lib/pysol_tests/acard_unit.py index 4b490753..e217ebca 100644 --- a/tests/lib/pysol_tests/acard_unit.py +++ b/tests/lib/pysol_tests/acard_unit.py @@ -19,9 +19,3 @@ class MyTests(unittest.TestCase): # TEST self.assertEqual(card2.rank, 7, 'card2.rank') - - -def mymain(): - from pycotap import TAPTestRunner - suite = unittest.TestLoader().loadTestsFromTestCase(MyTests) - TAPTestRunner().run(suite) diff --git a/tests/lib/pysol_tests/hint.py b/tests/lib/pysol_tests/hint.py index e0ddf55c..5318c34f 100644 --- a/tests/lib/pysol_tests/hint.py +++ b/tests/lib/pysol_tests/hint.py @@ -19,9 +19,3 @@ class MyTests(unittest.TestCase): # TEST self.assertEqual(got, '8D', 'card2str2 works') # diag('got == ' + got) - - -def mymain(): - from pycotap import TAPTestRunner - suite = unittest.TestLoader().loadTestsFromTestCase(MyTests) - TAPTestRunner().run(suite) diff --git a/tests/lib/pysol_tests/import_file1.py b/tests/lib/pysol_tests/import_file1.py index 7d1d350e..65b0343c 100644 --- a/tests/lib/pysol_tests/import_file1.py +++ b/tests/lib/pysol_tests/import_file1.py @@ -166,9 +166,3 @@ KD QC 5C QH 6S 3D self.assertEqual(err.cards, ["5H"]) return self.fail("No exception thrown.") - - -def mymain(): - from pycotap import TAPTestRunner - suite = unittest.TestLoader().loadTestsFromTestCase(MyTests) - TAPTestRunner().run(suite) diff --git a/tests/lib/pysol_tests/latin1_conv_unit.py b/tests/lib/pysol_tests/latin1_conv_unit.py index e1200f4b..70ac1d22 100644 --- a/tests/lib/pysol_tests/latin1_conv_unit.py +++ b/tests/lib/pysol_tests/latin1_conv_unit.py @@ -7,9 +7,3 @@ from pysollib.mfxutil import latin1_normalize class MyTests(unittest.TestCase): def test_output(self): self.assertEqual(latin1_normalize('HELLO%%good'), 'hellogood') - - -def mymain(): - from pycotap import TAPTestRunner - suite = unittest.TestLoader().loadTestsFromTestCase(MyTests) - TAPTestRunner().run(suite)