diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/test/scala/org/apache/spark/AccumulatorSuite.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala b/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala index 6cbd5ae5d4..6d03ee091e 100644 --- a/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala +++ b/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala @@ -100,7 +100,9 @@ class AccumulatorSuite extends SparkFunSuite with Matchers with LocalSparkContex val acc: Accumulator[Int] = sc.accumulator(0) val d = sc.parallelize(1 to 20) - an [Exception] should be thrownBy {d.foreach{x => acc.value = x}} + intercept[SparkException] { + d.foreach(x => acc.value = x) + } } test ("add value to collection accumulators") { @@ -171,7 +173,7 @@ class AccumulatorSuite extends SparkFunSuite with Matchers with LocalSparkContex d.foreach { x => acc.localValue ++= x } - acc.value should be ( (0 to maxI).toSet) + acc.value should be ((0 to maxI).toSet) resetSparkContext() } } |