diff options
author | Jonathan Lange <jml@canonical.com> | 2008-09-13 21:39:29 +1000 |
---|---|---|
committer | Jonathan Lange <jml@canonical.com> | 2008-09-13 21:39:29 +1000 |
commit | a40a7a209ef181ecd5f6741498c6f6e7835795dc (patch) | |
tree | bc106bcfe49da0eadcfaa4e9530862bc843676ff | |
parent | 5cd03e9181732f8fc94e08397d4407c72b522527 (diff) | |
download | testresources-git-a40a7a209ef181ecd5f6741498c6f6e7835795dc.tar.gz |
Move implementation to addTest, deprecating adsorbSuite.
-rw-r--r-- | lib/testresources/__init__.py | 13 |
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) |