summaryrefslogtreecommitdiff
path: root/testlib.py
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2010-09-27 15:50:27 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2010-09-27 15:50:27 +0200
commite6fe6e83fc8446dd1076f518c357ad89618a9467 (patch)
treee6e698e741229b7e400630170802e992c892ff50 /testlib.py
parentd30cb6f9e3d795069f3f594af2ae0c85e3f80a18 (diff)
downloadlogilab-common-e6fe6e83fc8446dd1076f518c357ad89618a9467.tar.gz
cleanup: _deprecate doesn't have to be an inner function
Diffstat (limited to 'testlib.py')
-rw-r--r--testlib.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/testlib.py b/testlib.py
index 4b9103a..2735c5c 100644
--- a/testlib.py
+++ b/testlib.py
@@ -489,7 +489,6 @@ class SkipAwareTextTestRunner(unittest.TextTestRunner):
if is_generator(func) and skipgenerator:
return self.does_match_tags(func) # Let inner tests decide at run time
-
# print 'testname', testname, self.test_pattern
if self._this_is_skipped(testname):
return False # this was explicitly skipped
@@ -1014,6 +1013,15 @@ class Tags(InheritableSet): # 2.4 compat
return eval(exp, {}, self)
+# duplicate definition from unittest2 of the _deprecate decorator
+def _deprecate(original_func):
+ def deprecated_func(*args, **kwargs):
+ warnings.warn(
+ ('Please use %s instead.' % original_func.__name__),
+ DeprecationWarning, 2)
+ return original_func(*args, **kwargs)
+ return deprecated_func
+
class TestCase(unittest.TestCase):
"""A unittest.TestCase extension with some additional methods."""
@@ -1021,15 +1029,6 @@ class TestCase(unittest.TestCase):
pdbclass = Debugger
tags = Tags()
- # duplicate definition from unittest2 of the _deprecate decorator
- def _deprecate(original_func):
- def deprecated_func(*args, **kwargs):
- warnings.warn(
- ('Please use %s instead.' % original_func.__name__),
- PendingDeprecationWarning, 2)
- return original_func(*args, **kwargs)
- return deprecated_func
-
def __init__(self, methodName='runTest'):
super(TestCase, self).__init__(methodName)
# internal API changed in python2.5