title: Not able to import Spark Implicits in ScalaTest
body: <p>I am writing Test Cases for Spark using ScalaTest.</p>
  
  <pre><code>import org.apache.spark.sql.SparkSession
  import org.scalatest.{BeforeAndAfterAll, FlatSpec}
  
  class ClassNameSpec extends FlatSpec with BeforeAndAfterAll {
    var spark: SparkSession = _
    var className: ClassName = _
  
    override def beforeAll(): Unit = {
      spark = SparkSession.builder().master("local").appName("class-name-test").getOrCreate()
      className = new ClassName(spark)
    }
  
    it should "return data" in {
      import spark.implicits._
      val result = className.getData(input)
  
      assert(result.count() == 3)
    }
  
    override def afterAll(): Unit = {
      spark.stop()
    }
  }
  </code></pre>
  
  <p>When I try to compile the test suite it gives me following error:</p>
  
  <pre><code>stable identifier required, but ClassNameSpec.this.spark.implicits found.
  [error]     import spark.implicits._
  [error]                  ^
  [error] one error found
  [error] (test:compileIncremental) Compilation failed
  </code></pre>
  
  <p>I am not able to understand why I cannot <code>import spark.implicits._</code> in a test suite.</p>
  
  <p>Any help is appreciated !</p>