aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/tests.py
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@apache.org>2014-07-27 22:54:43 -0700
committerMatei Zaharia <matei@databricks.com>2014-07-27 22:54:43 -0700
commita7d145e98c55fa66a541293930f25d9cdc25f3b4 (patch)
tree624282a2fdcd3f2a237ca1ffdd011d842dbf51c4 /python/pyspark/tests.py
parentd7eac4c3db7462e60e0c456dc93780167f5fcb2c (diff)
downloadspark-a7d145e98c55fa66a541293930f25d9cdc25f3b4.tar.gz
spark-a7d145e98c55fa66a541293930f25d9cdc25f3b4.tar.bz2
spark-a7d145e98c55fa66a541293930f25d9cdc25f3b4.zip
[SPARK-1550] [PySpark] Allow SparkContext creation after failed attempts
This addresses a PySpark issue where a failed attempt to construct SparkContext would prevent any future SparkContext creation. Author: Josh Rosen <joshrosen@apache.org> Closes #1606 from JoshRosen/SPARK-1550 and squashes the following commits: ec7fadc [Josh Rosen] [SPARK-1550] [PySpark] Allow SparkContext creation after failed attempts
Diffstat (limited to 'python/pyspark/tests.py')
-rw-r--r--python/pyspark/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py
index 8ba51461d1..63cc5e9ad9 100644
--- a/python/pyspark/tests.py
+++ b/python/pyspark/tests.py
@@ -209,6 +209,12 @@ class TestAddFile(PySparkTestCase):
class TestRDDFunctions(PySparkTestCase):
+ def test_failed_sparkcontext_creation(self):
+ # Regression test for SPARK-1550
+ self.sc.stop()
+ self.assertRaises(Exception, lambda: SparkContext("an-invalid-master-name"))
+ self.sc = SparkContext("local")
+
def test_save_as_textfile_with_unicode(self):
# Regression test for SPARK-970
x = u"\u00A1Hola, mundo!"