Permalink
Browse files

Add test for #25

  • Loading branch information...
jpellerin committed Feb 19, 2012
1 parent db2f6bd commit 583ab37ece15e1e27d1eb5e980ef7bcdc8a6afe9
Showing with 22 additions and 0 deletions.
  1. +22 −0 nose2/tests/unit/test_result.py
@@ -0,0 +1,22 @@
+from nose2 import result, session
+from nose2.tests._common import TestCase
+
+
+class TestPluggableTestResult(TestCase):
+ def setUp(self):
+ self.session = session.Session()
+ self.result = result.PluggableTestResult(self.session)
+
+ def test_skip_reason_not_discarded(self):
+ class Test(TestCase):
+ def test(self):
+ pass
+ plugin = FakePlugin()
+ self.session.hooks.register('testOutcome', plugin)
+ self.result.addSkip(Test('test'), 'because')
+ self.assertEqual(plugin.reason, 'because')
+
+
+class FakePlugin(object):
+ def testOutcome(self, event):
+ self.reason = event.reason

0 comments on commit 583ab37

Please sign in to comment.