I think it's better to initialize the SparkContext in before, rather than before all, so that there's a new one for each individual test.