You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by an...@apache.org on 2015/01/09 18:49:17 UTC

spark git commit: [PySpark] Fix tests with Python 2.6 in 0.9 branch

Repository: spark
Updated Branches:
  refs/heads/branch-0.9 63c0ff992 -> 7d007d352


[PySpark] Fix tests with Python 2.6 in 0.9 branch

[PySpark] [SPARK-2954] [SPARK-2948] [SPARK-2910] [SPARK-2101] Python 2.6 Fixes

    - Modify python/run-tests to test with Python 2.6
    - Use unittest2 when running on Python 2.6.

Author: Josh Rosen <joshrosenapache.org>

Closes #3668 from davies/port_2365 and squashes the following commits:

Author: cocoatomo <co...@gmail.com>

Closes #3968 from davies/fix_python_tests and squashes the following commits:

ac4a353 [cocoatomo] [PySpark] Fix tests with Python 2.6 in 1.0 branch


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/7d007d35
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/7d007d35
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/7d007d35

Branch: refs/heads/branch-0.9
Commit: 7d007d352abc312231a775cb05183a1be85bb8e3
Parents: 63c0ff9
Author: cocoatomo <co...@gmail.com>
Authored: Fri Jan 9 09:49:15 2015 -0800
Committer: Andrew Or <an...@databricks.com>
Committed: Fri Jan 9 09:49:15 2015 -0800

----------------------------------------------------------------------
 python/pyspark/tests.py | 11 ++++++++++-
 python/run-tests        | 10 ++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/7d007d35/python/pyspark/tests.py
----------------------------------------------------------------------
diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py
index 5b124d9..81ef80e 100644
--- a/python/pyspark/tests.py
+++ b/python/pyspark/tests.py
@@ -26,7 +26,16 @@ import shutil
 import sys
 from tempfile import NamedTemporaryFile
 import time
-import unittest
+
+if sys.version_info[:2] <= (2, 6):
+    try:
+        import unittest2 as unittest
+    except ImportError:
+        sys.stderr.write('Please install unittest2 to test with Python 2.6 or earlier')
+        sys.exit(1)
+else:
+    import unittest
+
 
 from pyspark.context import SparkContext
 from pyspark.files import SparkFiles

http://git-wip-us.apache.org/repos/asf/spark/blob/7d007d35/python/run-tests
----------------------------------------------------------------------
diff --git a/python/run-tests b/python/run-tests
index a986ac9..6eeef4c 100755
--- a/python/run-tests
+++ b/python/run-tests
@@ -33,6 +33,16 @@ function run_test() {
     FAILED=$((PIPESTATUS[0]||$FAILED))
 }
 
+echo "Running PySpark tests. Output is in python/unit-tests.log."
+
+# Try to test with Python 2.6, since that's the minimum version that we support:
+if [ $(which python2.6) ]; then
+    export PYSPARK_PYTHON="python2.6"
+fi
+
+echo "Testing with Python version:"
+$PYSPARK_PYTHON --version
+
 run_test "pyspark/rdd.py"
 run_test "pyspark/context.py"
 run_test "pyspark/conf.py"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org