You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2020/10/26 11:40:27 UTC
[zeppelin] branch master updated: [hotfix] Fix python unit test
This is an automated email from the ASF dual-hosted git repository.
zjffdu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push:
new 4088295 [hotfix] Fix python unit test
4088295 is described below
commit 40882956396660bf213dbb5757120a2010c3c04a
Author: Jeff Zhang <zj...@apache.org>
AuthorDate: Sat Oct 24 23:20:21 2020 +0800
[hotfix] Fix python unit test
---
.../zeppelin/python/IPythonInterpreterTest.java | 30 ++++++----------------
1 file changed, 8 insertions(+), 22 deletions(-)
diff --git a/python/src/test/java/org/apache/zeppelin/python/IPythonInterpreterTest.java b/python/src/test/java/org/apache/zeppelin/python/IPythonInterpreterTest.java
index f3361a4..c2d8ae3 100644
--- a/python/src/test/java/org/apache/zeppelin/python/IPythonInterpreterTest.java
+++ b/python/src/test/java/org/apache/zeppelin/python/IPythonInterpreterTest.java
@@ -84,7 +84,6 @@ public class IPythonInterpreterTest extends BasePythonInterpreterTest {
} catch (IOException e) {
throw new InterpreterException(e);
}
-
}
@Override
@@ -300,27 +299,14 @@ public class IPythonInterpreterTest extends BasePythonInterpreterTest {
InterpreterResult.Code.SUCCESS, result.code());
interpreterResultMessages = context.out.toInterpreterResultMessage();
- if (isPython2) {
- // python 2 will have one extra output
- // %text /home/travis/miniconda/lib/python2.7/site-packages/param/parameterized.py:2812:
- // UserWarning: Config option `use_jedi` not recognized by `IPCompleter`.
- // return inst.__call__(*args,**params)
- assertEquals(5, interpreterResultMessages.size());
- assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(1).getType());
- assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(2).getType());
- assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(3).getType());
- assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(4).getType());
- // docs_json is the source data of plotting which bokeh would use to render the plotting.
- assertTrue(interpreterResultMessages.get(4).getData().contains("docs_json"));
- } else {
- assertEquals(4, interpreterResultMessages.size());
- assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(0).getType());
- assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(1).getType());
- assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(2).getType());
- assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(3).getType());
- // docs_json is the source data of plotting which bokeh would use to render the plotting.
- assertTrue(interpreterResultMessages.get(3).getData().contains("docs_json"));
- }
+ assertEquals(context.out.toString(), 5, interpreterResultMessages.size());
+ // the first message is the warning text message.
+ assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(1).getType());
+ assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(2).getType());
+ assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(3).getType());
+ assertEquals(InterpreterResult.Type.HTML, interpreterResultMessages.get(4).getType());
+ // docs_json is the source data of plotting which bokeh would use to render the plotting.
+ assertTrue(interpreterResultMessages.get(4).getData().contains("docs_json"));
}