Rashmi Pandit
Rashmi Pandit

Reputation: 23788

Nunit 3: Can tests in one class run in parallel with Parallelizable attribute?

I am using

 [TestFixture]
 [Parallelizable(ParallelScope.Children)]
 public class MyTests
 {
 }

There are 5 tests within this class.

I am using NUnit 3 Test Adapter.

I also have the below in my AssemblyInfo of test project:

[assembly: Parallelizable(ParallelScope.Fixtures)]

In the test window I notice that multiple classes are running in parallel. However, the tests within each class are run synchronously.

How can I achieve parallelism within each class?

Upvotes: 2

Views: 730

Answers (1)

plainionist
plainionist

Reputation: 3563

I just tried

[assembly: Parallelizable(ParallelScope.All)]

which, according to test explorer progress indicators, caused multiple test methods to run in parallel. This option als was slightly faster than

ParallelScope.Fixtures

I am using NUnit3TestAdapter version 4.3.1 in VS 2022.

Upvotes: 0

Related Questions