Skip to content

Commit 617ab8f

Browse files
committed
improve test
1 parent 358bc0e commit 617ab8f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,11 @@ class FileIndexSuite extends SharedSparkSession {
363363
wrongBasePath.mkdir()
364364
val parameters = Map("basePath" -> wrongBasePath.getCanonicalPath)
365365
val fileIndex = new InMemoryFileIndex(spark, Seq(path), parameters, None)
366-
intercept[IllegalArgumentException] {
366+
val msg = intercept[IllegalArgumentException] {
367367
// trigger inferPartitioning()
368368
fileIndex.partitionSpec()
369-
}
369+
}.getMessage
370+
assert(msg === s"Wrong basePath ${wrongBasePath.getCanonicalPath} for the root path: $path")
370371
}
371372
}
372373

0 commit comments

Comments
 (0)