summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/case.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/case.py')
-rw-r--r--Lib/unittest/case.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index e2f0ed3..9fbf852 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -653,8 +653,16 @@ class TestCase(object):
def debug(self):
"""Run the test without collecting errors in a TestResult"""
+ testMethod = getattr(self, self._testMethodName)
+ if (getattr(self.__class__, "__unittest_skip__", False) or
+ getattr(testMethod, "__unittest_skip__", False)):
+ # If the class or method was skipped.
+ skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
+ or getattr(testMethod, '__unittest_skip_why__', ''))
+ raise SkipTest(skip_why)
+
self.setUp()
- getattr(self, self._testMethodName)()
+ testMethod()
self.tearDown()
while self._cleanups:
function, args, kwargs = self._cleanups.pop(-1)