Tian Gao created SPARK-62340:
--------------------------------

             Summary: Add a test for SparkContext constructor arguments and 
init errors
                 Key: SPARK-62340
                 URL: https://issues.apache.org/jira/browse/SPARK-62340
             Project: Spark
          Issue Type: Test
          Components: PySpark
    Affects Versions: 5.0.0
            Reporter: Tian Gao


9 lines of `SparkContext._do_init` in `python/pyspark/core/context.py` were not 
covered by any test; this adds coverage for the `sparkHome`, `environment` and 
`pyFiles` arguments and for the error and warning paths 
(https://github.com/apache/spark/blob/d1c23f147cf56d5a63b2058c4af4207b4136d279/python/pyspark/core/context.py#L265-L283
 and 
https://github.com/apache/spark/blob/d1c23f147cf56d5a63b2058c4af4207b4136d279/python/pyspark/core/context.py#L354-L379).
 Existing tests create a `SparkContext` with no arguments or only master/app 
name. The test JVM is launched through `spark-submit`, which sets 
`spark.master` and `spark.app.name`, so the missing-setting errors only fire 
with `SparkConf(loadDefaults=False)` once the JVM is running.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to