summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Lange <jml@canonical.com>2008-09-13 21:39:29 +1000
committerJonathan Lange <jml@canonical.com>2008-09-13 21:39:29 +1000
commita40a7a209ef181ecd5f6741498c6f6e7835795dc (patch)
treebc106bcfe49da0eadcfaa4e9530862bc843676ff
parent5cd03e9181732f8fc94e08397d4407c72b522527 (diff)
downloadtestresources-git-a40a7a209ef181ecd5f6741498c6f6e7835795dc.tar.gz
Move implementation to addTest, deprecating adsorbSuite.
-rw-r--r--lib/testresources/__init__.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/testresources/__init__.py b/lib/testresources/__init__.py
index 8e04cbe..f8da8f0 100644
--- a/lib/testresources/__init__.py
+++ b/lib/testresources/__init__.py
@@ -48,11 +48,16 @@ class OptimisingTestSuite(unittest.TestSuite):
"""A resource creation optimising TestSuite."""
def adsorbSuite(self, test_case_or_suite):
- """Add `test_case_or_suite`, unwrapping any suites we find.
+ """Deprecated. Use addTest instead."""
+ self.addTest(test_case_or_suite)
- This means that any containing TestSuites will be removed. These
- suites might have their own unittest extensions, so be careful with
- this.
+ def addTest(self, test_case_or_suite):
+ """Add `test_case_or_suite`, unwrapping standard TestSuites.
+
+ This means that any containing unittest.TestSuites will be removed,
+ while any custom test suites will be 'distributed' across their
+ members. Thus addTest(CustomSuite([a, b])) will result in
+ CustomSuite([a]) and CustomSuite([b]) being added to this suite.
"""
try:
tests = iter(test_case_or_suite)