[testlib] handle skips in setUp and tearDown

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

authorJulien Cristau <julien.cristau@logilab.fr>
changesete0434df41a2e
branchdefault
phasepublic
hiddenno
parent revision#14436aa69ef0 [modutils] fix support for extend_path based namespace package when module is nested in a sub-package. Closes #177651
child revision#9450099defff [date] Fixed: wrong incrementation of month in date_range function (closes #186698).
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 e0434df41a2eeef6bb97707ed941a7210c8866a7
# Parent 14436aa69ef0d23b165b393a6d224da87e4135b0
[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