diff options
author | Jonathan Lange <jml@canonical.com> | 2008-10-04 14:15:21 +1000 |
---|---|---|
committer | Jonathan Lange <jml@canonical.com> | 2008-10-04 14:15:21 +1000 |
commit | f063c2cf4ce1a3217e15b3d4440628d64943d0d6 (patch) | |
tree | f835ae2ac56beaf4318dc552dcabdb40e231d99c | |
parent | 9708919e2da7cd8f90166f18ba1fd950ba0e8026 (diff) | |
download | testresources-f063c2cf4ce1a3217e15b3d4440628d64943d0d6.tar.gz |
Use testtools not pyunit3k.
-rw-r--r-- | .bzrignore | 1 | ||||
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | lib/testresources/__init__.py | 2 | ||||
-rw-r--r-- | lib/testresources/tests/test_optimising_test_suite.py | 16 | ||||
-rw-r--r-- | lib/testresources/tests/test_resourced_test_case.py | 6 | ||||
-rw-r--r-- | lib/testresources/tests/test_test_loader.py | 4 | ||||
-rw-r--r-- | lib/testresources/tests/test_test_resource.py | 4 |
7 files changed, 20 insertions, 19 deletions
@@ -1,3 +1,4 @@ TAGS tags lib/pyunit3k +lib/testtools @@ -27,10 +27,10 @@ Dependencies: ============= * Python 2.4+ -* pyunit3k +* testtools -Note that pyunit3k is required for *running* the tests for testresources. You -can use testresources in your own app without using pyunit3k. +Note that testtools is required for *running* the tests for testresources. You +can use testresources in your own app without using testtools. How testresources works: diff --git a/lib/testresources/__init__.py b/lib/testresources/__init__.py index 5edbf17..42a8c93 100644 --- a/lib/testresources/__init__.py +++ b/lib/testresources/__init__.py @@ -17,7 +17,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -from pyunit3k import iterate_tests +from testtools import iterate_tests import unittest diff --git a/lib/testresources/tests/test_optimising_test_suite.py b/lib/testresources/tests/test_optimising_test_suite.py index 79dc14e..842b689 100644 --- a/lib/testresources/tests/test_optimising_test_suite.py +++ b/lib/testresources/tests/test_optimising_test_suite.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -import pyunit3k +import testtools import random import testresources from testresources import split_by_resources @@ -48,7 +48,7 @@ class MakeCounter(testresources.TestResource): return "boo" -class TestOptimisingTestSuite(pyunit3k.TestCase): +class TestOptimisingTestSuite(testtools.TestCase): def makeTestCase(self): """Make a normal TestCase.""" @@ -64,7 +64,7 @@ class TestOptimisingTestSuite(pyunit3k.TestCase): return test_case def setUp(self): - pyunit3k.TestCase.setUp(self) + testtools.TestCase.setUp(self) self.optimising_suite = testresources.OptimisingTestSuite() def testAdsorbTest(self): @@ -142,7 +142,7 @@ class TestOptimisingTestSuite(pyunit3k.TestCase): self.assertEqual(suite.sorted, True) -class TestSplitByResources(pyunit3k.TestCase): +class TestSplitByResources(testtools.TestCase): """Tests for split_by_resources.""" def makeTestCase(self): @@ -188,11 +188,11 @@ class TestSplitByResources(pyunit3k.TestCase): self.assertEqual(set(resourced_cases), set(haves)) -class TestCostOfSwitching(pyunit3k.TestCase): +class TestCostOfSwitching(testtools.TestCase): """Tests for cost_of_switching.""" def setUp(self): - pyunit3k.TestCase.setUp(self) + testtools.TestCase.setUp(self) self.suite = testresources.OptimisingTestSuite() def makeResource(self, setUpCost=1, tearDownCost=1): @@ -241,7 +241,7 @@ class TestCostOfSwitching(pyunit3k.TestCase): 2, self.suite.cost_of_switching(set([a, c]), set([b, c]))) -class TestCostGraph(pyunit3k.TestCase): +class TestCostGraph(testtools.TestCase): """Tests for calculating the cost graph of resourced test cases.""" def makeResource(self, setUpCost=1, tearDownCost=1): @@ -280,7 +280,7 @@ class TestCostGraph(pyunit3k.TestCase): set(a.resources), set(b.resources))}}, graph) -class TestGraphStuff(pyunit3k.TestCase): +class TestGraphStuff(testtools.TestCase): def setUp(self): diff --git a/lib/testresources/tests/test_resourced_test_case.py b/lib/testresources/tests/test_resourced_test_case.py index f2966af..31b29fa 100644 --- a/lib/testresources/tests/test_resourced_test_case.py +++ b/lib/testresources/tests/test_resourced_test_case.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -import pyunit3k +import testtools import testresources @@ -39,10 +39,10 @@ class MockResource(testresources.TestResource): return self._resource -class TestResourcedTestCase(pyunit3k.TestCase): +class TestResourcedTestCase(testtools.TestCase): def setUp(self): - pyunit3k.TestCase.setUp(self) + testtools.TestCase.setUp(self) self.resourced_case = testresources.ResourcedTestCase('run') self.resource = self.getUniqueString() self.resource_manager = MockResource(self.resource) diff --git a/lib/testresources/tests/test_test_loader.py b/lib/testresources/tests/test_test_loader.py index a7983e1..f7f9385 100644 --- a/lib/testresources/tests/test_test_loader.py +++ b/lib/testresources/tests/test_test_loader.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -import pyunit3k +import testtools from testresources import TestLoader, OptimisingTestSuite from testresources.tests import TestUtil @@ -29,7 +29,7 @@ def test_suite(): return result -class TestTestLoader(pyunit3k.TestCase): +class TestTestLoader(testtools.TestCase): def testSuiteType(self): # The testresources TestLoader loads tests into an diff --git a/lib/testresources/tests/test_test_resource.py b/lib/testresources/tests/test_test_resource.py index d822487..59f8729 100644 --- a/lib/testresources/tests/test_test_resource.py +++ b/lib/testresources/tests/test_test_resource.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -import pyunit3k +import testtools import testresources @@ -45,7 +45,7 @@ class MockResource(testresources.TestResource): return "Boo!" -class TestTestResource(pyunit3k.TestCase): +class TestTestResource(testtools.TestCase): def testUnimplementedGetResource(self): # By default, TestResource raises NotImplementedError on getResource. |