Skip to content

Imports and various versions #36

@vreuter

Description

@vreuter

For a long time I was having trouble w/ 3.0.x --> 3.1.x migration, but everywhere I'm using scalatest and scalatestplus been running pretty smoothly for a while now. I had an old repo that was still on 3.0.8, though, and today I upped to 3.1.2, and I hit an issue I used to have with one of the imports:

[error] <test-file-pathh>.scala:5:12: object scalatestplus is not a member of package org
[error] import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
[error]            ^
[error]  <test-file-path>.scala:12:58: not found: type ScalaCheckDrivenPropertyChecks
[error] class TestPhrases extends AnyFunSuite with Matchers with ScalaCheckDrivenPropertyChecks {

What was strange was that I'd matched imports in a test file and dependency declarations in the build file to files from a project where 3.1.2 working great:

build.sbt:

libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.14.3" % "test"
libraryDependencies += "org.scalactic" %% "scalactic" % "3.1.2" % "test"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % "test"

Imports in test file:

import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks

Yet, in one project the tests could run great through sbt and in the other I ran up against the import error. Turns out, in the project where things were working, I was also using discipline:

libraryDependencies += "org.typelevel" %% "discipline-scalatest" % "1.0.1"

Adding that dependency to the problematic project got things working. Is it known why that would be?

I guess not a big deal, but I'm definitely curious if anyone can point me toward the reason. Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions