@Test public void testUncaughtPythonExceptionInsideScript() throws Exception {
String[] codeTest = { "def callthrowstuff():", " throwstuff()", "", "def test():", " callthrowstuff()", "",
"def throwstuff():", " raise NameError, 'dingleberry'" };
createScriptAndExecute(TrivialFixture.convertCode(TrivialFixture.codeFixture, codeTest));
assertEquals("failure count", 1, result.failureCount());
Failure failure = result.failures()[0];
assertEquals("failure message", "<type 'exceptions.NameError'>: dingleberry", failure.getMessage());
SourceLine[] traceback = failure.getTraceback();
assertNotNull("traceback", traceback);
assertEquals("traceback length", 6, traceback.length);
assertSourceLine(traceback, 0, "throwstuff", 21);
assertSourceLine(traceback, 1, "callthrowstuff", 15);
assertSourceLine(traceback, 2, "test", 18);