diff options
Diffstat (limited to 'python/pyspark/tests.py')
-rw-r--r-- | python/pyspark/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py index 63cc87e0c4..3c51809444 100644 --- a/python/pyspark/tests.py +++ b/python/pyspark/tests.py @@ -1883,6 +1883,10 @@ class ContextTests(unittest.TestCase): # Regression test for SPARK-1550 self.assertRaises(Exception, lambda: SparkContext("an-invalid-master-name")) + def test_get_or_create(self): + with SparkContext.getOrCreate() as sc: + self.assertTrue(SparkContext.getOrCreate() is sc) + def test_stop(self): sc = SparkContext() self.assertNotEqual(SparkContext._active_spark_context, None) |