How to run tests in a class sequentially in ScalaTest?

I have a class that extends org.scalatest.junit.JUnitSuite. This class has several tests. I do not want these tests to run in parallel.

I know how simple it is with Specs2 (extending a class using a specification and adding a separate line sequentialinside the class), as shown below: How to execute the specifications sequentially .

I do not want to modify the build file by installing: parallelExecution in Test := false and I do not want to use tags to run certain test files sequentially.

All I want is a way to make sure that all tests inside my class are executed sequentially. Is this possible with ScalaTest? Any test sample / template is appreciated.

A quick Google search pointed me to this: http://doc.scalatest.org/2.0/index.html#org.scalatest.Sequential

Just for the pair of tests that I have, I think this is a complete excess for creating StepSuites. I'm not quite sure what will happen to my case!

+4
source share
1 answer

doc fororg.scalatest.ParallelTestExecution says

The usual ScalaTest approach for running test suites in parallel is to run different suites in parallel, but the tests of any of them are sequential.

So, it looks like you don't have to do anything to get what you want if your tests are in the same package.

+9
source

Source: https://habr.com/ru/post/1598281/