Skip to content

Commit 4088295

Browse files
committed
[hotfix] Fix python unit test
1 parent b1aac73 commit 4088295

1 file changed

Lines changed: 8 additions & 22 deletions

File tree

‎python/src/test/java/org/apache/zeppelin/python/IPythonInterpreterTest.java‎

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public void setUp() throws InterpreterException {
8484
} catch (IOException e) {
8585
throw new InterpreterException(e);
8686
}
87-
8887
}
8988

9089
@Override
@@ -300,27 +299,14 @@ public void testIPythonPlotting() throws InterpreterException, InterruptedExcept
300299
InterpreterResult.Code.SUCCESS, result.code());
301300
interpreterResultMessages = context.out.toInterpreterResultMessage();
302301

303-
if (isPython2) {
304-
// python 2 will have one extra output
305-
// %text /home/travis/miniconda/lib/python2.7/site-packages/param/parameterized.py:2812:
306-
// UserWarning: Config option `use_jedi` not recognized by `IPCompleter`.
307-
// return inst.__call__(*args,**params)
308-
assertEquals(5, interpreterResultMessages.size());
309-
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(1).getType());
310-
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(2).getType());
311-
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(3).getType());
312-
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(4).getType());
313-
// docs_json is the source data of plotting which bokeh would use to render the plotting.
314-
assertTrue(interpreterResultMessages.get(4).getData().contains("docs_json"));
315-
} else {
316-
assertEquals(4, interpreterResultMessages.size());
317-
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(0).getType());
318-
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(1).getType());
319-
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(2).getType());
320-
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(3).getType());
321-
// docs_json is the source data of plotting which bokeh would use to render the plotting.
322-
assertTrue(interpreterResultMessages.get(3).getData().contains("docs_json"));
323-
}
302+
assertEquals(context.out.toString(), 5, interpreterResultMessages.size());
303+
// the first message is the warning text message.
304+
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(1).getType());
305+
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(2).getType());
306+
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(3).getType());
307+
assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(4).getType());
308+
// docs_json is the source data of plotting which bokeh would use to render the plotting.
309+
assertTrue(interpreterResultMessages.get(4).getData().contains("docs_json"));
324310
}
325311

326312

0 commit comments

Comments
 (0)