[testlib] handle skips in setUp and tearDown

Don't turn them into errors. Closes #190806.

authorJulien Cristau <julien.cristau@logilab.fr>
changeset0eb17fe0d9da
branchdefault
phasedraft
hiddenyes
parent revision#1ad9bfc058cf [packaging] fix regression introduced by aefd37dbb754 leading to crash when installing python3 version of the lib on a linux platform
child revision<not specified>
files modified by this revision
testlib.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1385141837 -3600
# Fri Nov 22 18:37:17 2013 +0100
# Node ID 0eb17fe0d9daa0dc7c6218c4231250b2f2c6b9b7
# Parent 1ad9bfc058cf19eb453ff558415bc62c1ca158e1
[testlib] handle skips in setUp and tearDown

Don't turn them into errors. Closes #190806.

diff --git a/testlib.py b/testlib.py
@@ -548,10 +548,13 @@
1      def quiet_run(self, result, func, *args, **kwargs):
2          try:
3              func(*args, **kwargs)
4          except (KeyboardInterrupt, SystemExit):
5              raise
6 +        except unittest.SkipTest, e:
7 +            self._addSkip(result, str(e))
8 +            return False
9          except:
10              result.addError(self, self.__exc_info())
11              return False
12          return True
13