Skip to content

Commit 27c70a7

Browse files
committed
Restore the Func<TestOutputHelper> so we re-create the output helper for each test
1 parent 1fac6f8 commit 27c70a7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/xunit.execution/Sdk/Frameworks/Runners/XunitTestRunner.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ protected override async Task<Tuple<decimal, string>> InvokeTestAsync(ExceptionA
5454
var output = string.Empty;
5555

5656
TestOutputHelper testOutputHelper = null;
57+
int testOutputHelperIdx = -1;
5758
for (int idx = 0; idx < ConstructorArguments.Length; ++idx)
5859
if (ConstructorArguments[idx] is Func<TestOutputHelper>)
5960
{
61+
testOutputHelperIdx = idx;
6062
testOutputHelper = new TestOutputHelper();
6163
ConstructorArguments[idx] = testOutputHelper;
6264
break;
@@ -71,6 +73,7 @@ protected override async Task<Tuple<decimal, string>> InvokeTestAsync(ExceptionA
7173
{
7274
output = testOutputHelper.Output;
7375
testOutputHelper.Uninitialize();
76+
ConstructorArguments[testOutputHelperIdx] = () => new TestOutputHelper();
7477
}
7578

7679
return Tuple.Create(executionTime, output);

0 commit comments

Comments
 (0)