Meziantou.Xunit.ParallelTestFramework icon indicating copy to clipboard operation
Meziantou.Xunit.ParallelTestFramework copied to clipboard

Incompatible with xunit.assemblyfixture

Open tg2k opened this issue 2 years ago • 4 comments

If I add this to a project already using xunit.assemblyfixture, there's a conflict due to duplicate Xunit.TestFramework attributes generated. Is there any way to get the benefits of both packages?

tg2k avatar Jan 29 '23 17:01 tg2k

You need to create your own XunitTestFrameworkExecutor that composes both solutions. Note that if only need to run some initialization code (no Dispose), you can use a Module initializer instead of AssemblyFixture.

Also, you can disable the generation of the Xunit.TestFramework attribute by adding the following property to the csproj:

<PropertyGroup>
  <IncludeMeziantouXunitParallelTestFramework>false</IncludeMeziantouXunitParallelTestFramework>
</PropertyGroup>

meziantou avatar Jan 29 '23 20:01 meziantou

I am seeing the same issue as tg2k.
Error CS0579 Duplicate 'Xunit.TestFramework' attribute Do you have any documentation on how to integrate this into an existing XUnitTestFrameworkExecutor so that both can be used?

blrvw avatar Jun 27 '23 21:06 blrvw

I am getting the same issue. Could you please explain how to do this "You need to create your own XunitTestFrameworkExecutor that composes both solutions."

jusefb avatar Jun 30 '23 16:06 jusefb

I am also having this issue, so I would also like some more example on how to this.

svartis avatar Nov 02 '23 16:11 svartis