

def test_signalledExit(self):
    '\n        An error should be reported if the JavaScript interpreter exits because\n        it received a signal.\n        '
    segfault = FilePath(self.mktemp())
    segfault.setContent('#!/usr/bin/python\n# Generate an unhandled SIGSEGV for this process immediately upon import.\n\nimport os, signal\nos.kill(os.getpid(), signal.SIGSEGV)\n')

    def stubFinder():
        return sys.executable

    def stubScript(testModule):
        return segfault.path
    self.case.findJavascriptInterpreter = stubFinder
    self.case.makeScript = stubScript
    result = TestResult()
    self.case.run(result)
    self.assertEqual(len(result.errors), 1)
    self.assertEquals(result.errors[0][1], 'Exception: JavaScript interpreter exited due to signal 11\n')

dataset/ETHPy150Open twisted/nevow/nevow/test/test_testutil.py JavaScriptTests.test_signalledExit/original