Skip to content

Parallelizable TestFixtureSource with TestFixtureData not running in parallel #3735

Description

@LifshesOfer

NUnit (targeting .NET 5) does not run my TestFixture in parallel instances when using TestFixtureSource:

public class TestFixtureCases
{
	public static IEnumerable Cases
	{
		get
		{
			yield return new TestFixtureData("string1");
			yield return new TestFixtureData("string2");
			yield return new TestFixtureData("string3");
		}
	}
}
[TestFixture]
[Parallelizable]
[TestFixtureSource(typeof(TestFixtureCases), nameof(TestFixtureCases.Cases))]
public class FixtureClass : BasicFixtureClass
{
	public FixtureClass(string fixtureCase) : base(fixtureCase)
	{ }

	[Test]
	public void test1()
	{ }
	[Test]
	public void test2()
	{ }
}

However, if I'm giving the FixtureCases like the below, it does run in multiple instances:

[TestFixture("string1")]
[TestFixture("string2")]
[TestFixture("string3")]
[Parallelizable]
public class FixtureClass : BasicFixtureClass
{
	public FixtureClass(string fixtureCase) : base(fixtureCase)
	{ }

	[Test]
	public void test1()
	{ }
	[Test]
	public void test2()
	{ }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions