Testing with Twisted and inlineCallbacks
Here is my function definition: @defer.inlineCallbacks def get_order(order_id): # do some db operations... defer.returnValue(order_details) What I want to do is to test this function using Twisted's trial: from twisted.trial import unittest from twisted.internet import defer class OrderTest(unittest.TestCase): @defer.inlineCallbacks def test_order(self): order = yield get_order(5) raise Exception('FAIL FAIL!!') # this should fail, but never does self.assertEqual(order.id, 6) I'm very confused.. I red all the documents that I could find about Twisted and trial but couldn't find how to make this