From 0c0a43b8266694a02f6b3ad5f63a9ef969ef8f3b Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Tue, 16 Dec 2008 17:28:27 +0600 Subject: [PATCH] better error messages in case of test failure --- greentest/coros_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/greentest/coros_test.py b/greentest/coros_test.py index 607af5b..bf509d9 100644 --- a/greentest/coros_test.py +++ b/greentest/coros_test.py @@ -31,7 +31,7 @@ class TestEvent(tests.TestCase): mode = 'static' def setUp(self): # raise an exception if we're waiting forever - self._cancel_timeout = api.exc_after(1, RuntimeError()) + self._cancel_timeout = api.exc_after(1, RuntimeError('test takes too long')) def tearDown(self): self._cancel_timeout.cancel() @@ -103,11 +103,11 @@ class TestEvent(tests.TestCase): def test_double_exception(self): evt = coros.event() # send an exception through the event - evt.send(exc=RuntimeError()) + evt.send(exc=RuntimeError('from test_double_exception')) self.assertRaises(RuntimeError, evt.wait) evt.reset() # shouldn't see the RuntimeError again - api.exc_after(0.001, api.TimeoutError) + api.exc_after(0.001, api.TimeoutError('from test_double_exception')) self.assertRaises(api.TimeoutError, evt.wait)