eclean/test_search: fix test_main and mark so nosetests will ignore it
authorW. Trevor King <wking@tremily.us>
Mon, 12 Nov 2012 03:13:12 +0000 (22:13 -0500)
committerW. Trevor King <wking@tremily.us>
Mon, 12 Nov 2012 03:22:30 +0000 (22:22 -0500)
pym/gentoolkit/test/eclean/test_search.py [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 7980161..7e27f9e
@@ -16,11 +16,6 @@ from tempfile import NamedTemporaryFile, mkdtemp
 import unittest
 import re
 
-try:
-       from test import test_support
-except ImportError:
-       from test import support as test_support
-
 from gentoolkit.test.eclean.distsupport import *
 import gentoolkit.eclean.search as search
 from gentoolkit.eclean.search import DistfilesSearch
@@ -618,14 +613,13 @@ class TestRemoveProtected(unittest.TestCase):
 
 
 def test_main():
-
-       # Run tests
-       test_support.run_unittest(TestCheckLimits('test_check_limits'))
-       test_support.run_unittest( TestFetchRestricted('test__fetch_restricted'))
-       test_support.run_unittest( TestFetchRestricted('test_unrestricted'))
-       test_support.run_unittest( TestNonDestructive('test_non_destructive'))
-       test_support.run_unittest( TestNonDestructive('test_destructive'))
-       test_support.run_unittest( TestRemoveProtected('test_remove_protected'))
+       suite = unittest.TestLoader()
+       suite.loadTestsFromTestCase(TestCheckLimits)
+       suite.loadTestsFromTestCase(TestFetchRestricted)
+       suite.loadTestsFromTestCase(TestNonDestructive)
+       suite.loadTestsFromTestCase(TestRemoveProtected)
+       unittest.TextTestRunner(verbosity=2).run(suite)
+test_main.__test__ = False
 
 
 if __name__ == '__main__':