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:41:51 UTC

[zeppelin] branch branch-0.9 updated: [hotfix] Fix python unit test

This is an automated email from the ASF dual-hosted git repository.

zjffdu pushed a commit to branch branch-0.9
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/branch-0.9 by this push:
     new 2681978  [hotfix] Fix python unit test
2681978 is described below

commit 2681978dbd912b236cd63370a81e799c19ba8c85
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"));
   }