summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <julien.cristau@logilab.fr>2014-09-22 18:51:38 +0200
committerJulien Cristau <julien.cristau@logilab.fr>2014-09-22 18:51:38 +0200
commit4bc268065496e5ecba63e4fd69eebbe7bf2c6f17 (patch)
tree64ebc6a30f8bb09560ee1baa6ade76c2182e5324
parent911bd12eed4e5984f1a4aeaff63306d7300fe116 (diff)
downloadlogilab-common-4bc268065496e5ecba63e4fd69eebbe7bf2c6f17.tar.gz
[testlib] stop using internal unittest _addSkip method
I introduced this in changeset e0434df41a2e "[testlib] handle skips in setUp and tearDown". Turns out that API changed in python 3.4, so let's stop using it.
-rw-r--r--testlib.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/testlib.py b/testlib.py
index 22c58bb..f0b8e2f 100644
--- a/testlib.py
+++ b/testlib.py
@@ -531,7 +531,12 @@ class TestCase(unittest.TestCase):
except (KeyboardInterrupt, SystemExit):
raise
except unittest.SkipTest as e:
- self._addSkip(result, str(e))
+ if hasattr(result, 'addSkip'):
+ result.addSkip(self, str(e))
+ else:
+ warnings.warn("TestResult has no addSkip method, skips not reported",
+ RuntimeWarning, 2)
+ result.addSuccess(self)
return False
except:
result.addError(self, self.__exc_info())