def test_inlineCallbacksTracebacks(self):
        """
        L{defer.inlineCallbacks} that re-raise tracebacks into their deferred
        should not lose their tracebacks.
        """
        f = getDivisionFailure()
        d = defer.Deferred()
        try:
            f.raiseException()
        except:
            d.errback()

        def ic(d):
            yield d
        ic = defer.inlineCallbacks(ic)
        newFailure = self.failureResultOf(d)
        tb = traceback.extract_tb(newFailure.getTracebackObject())

        if _PY3:
            self.assertEqual(len(tb), 3)
            self.assertIn('test_defer', tb[2][0])
            self.assertEqual('getDivisionFailure', tb[2][2])
            self.assertEqual('1/0', tb[2][3])
        else:
            self.assertEqual(len(tb), 2)
            self.assertIn('test_defer', tb[1][0])
            self.assertEqual('getDivisionFailure', tb[1][2])
            self.assertEqual('1/0', tb[1][3])
        self.assertIn('test_defer', tb[0][0])
        self.assertEqual('test_inlineCallbacksTracebacks', tb[0][2])
        self.assertEqual('f.raiseException()', tb[0][3])

        L{defer.inlineCallbacks} that re-raise tracebacks into their deferred
        should not lose their tracebacks.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_defer.py