From c396b61a982fe5cc0bbb395ba8709454b358e009 Mon Sep 17 00:00:00 2001 From: Christopher Sang Date: Sat, 3 Jan 2015 16:16:09 -0500 Subject: [PATCH] Implement support for unittest.expectedFailure Fixes issue #33 --- nose/proxy.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nose/proxy.py b/nose/proxy.py index c2676cb1..b202264b 100644 --- a/nose/proxy.py +++ b/nose/proxy.py @@ -159,6 +159,17 @@ def addSkip(self, test, reason): plugins.addError(self.test, (SkipTest, reason, None)) self.result.addSkip(self.test, reason) + def addExpectedFailure(self, test, err): + self.assertMyTest(test) + self.result.addExpectedFailure(self.test, self._prepareErr(err)) + + def addUnexpectedSuccess(self, test): + self.assertMyTest(test) + self.test.passed = False + self.result.addUnexpectedSuccess(self.test) + if self.config.stopOnError: + self.shouldStop = True + def addSuccess(self, test): self.assertMyTest(test) self.plugins.addSuccess(self.test)