Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 06:25 AM
Currently I am creating unit tests for our ETL scripts although the test is not able to recognize sc (SparkContext).
Is there a way to mock SparkContext for a unit test?
Code being tested: df = spark.read.json(sc.parallelize([data]))
Error message received when running PyTest: NameError: name 'sc' is not defined