Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imports and various versions #36

Open
vreuter opened this issue Jul 30, 2020 · 1 comment
Open

Imports and various versions #36

vreuter opened this issue Jul 30, 2020 · 1 comment

Comments

@vreuter
Copy link

vreuter commented Jul 30, 2020

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!

@jan0sch
Copy link

jan0sch commented Feb 16, 2022

I just stumbled upon the same issue but not triggered by scalatestplus update but by updating another library (monocle). The same error message and it was solved also by manually including discipline-scalatest into the dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants