def test_tracebackMessages(self):
        writtenToTwisted = self.redirectToLogPublisher()
        written = self.redirectToList()
        logger = Logger()

        def raiser():
            raise RuntimeError("because")
        try:
            raiser()
        except Exception:
            expectedTraceback = traceback.format_exc()
            writeTraceback(logger)

        lines = expectedTraceback.split("\n")
        # Remove source code lines:
        expectedTraceback = "\n".join(
            [l for l in lines if not l.startswith("    ")])

        self.assertEqual(writtenToTwisted,
                         ["ELIOT: %s" % (json.dumps(written[0]),),
                          "ELIOT Extracted Traceback:\n%s" % (expectedTraceback,)
                      ])
Add site-packages (and possibly site-python) to sys.path
dataset/ETHPy150Open ClusterHQ/eliot/eliot/tests/test_twisted.py/RedirectLogsForTrialTests.test_tracebackMessages--crossover with--dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/site.py/addsitepackages