Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@ internal async Task<TestResult[]> RunSingleTestAsync(TestMethod testMethod, IDic
testContextForClassCleanup = PlatformServiceProvider.Instance.GetTestContext(testMethod: null, testMethod.FullClassName, testContextProperties, messageLogger, testContextForTestExecution.Context.CurrentTestOutcome);

_classCleanupManager.MarkTestComplete(testMethod, out bool isLastTestInClass);
if (isLastTestInClass && testMethodInfo is not null)
if (isLastTestInClass)
{
await testMethodInfo.Parent.RunClassCleanupAsync(testContextForClassCleanup, result).ConfigureAwait(false);
if (testMethodInfo is not null)
{
await testMethodInfo.Parent.RunClassCleanupAsync(testContextForClassCleanup, result).ConfigureAwait(false);
}

// Mark the class as complete when all class cleanups are complete. When all classes are complete we progress to running assembly cleanup.
// Class is not complete until after all class cleanups are done, to prevent running assembly cleanup too early.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
[TestClass]
public class TestClass1
{
public static bool ClassCleanupFinished { get; private set; }

[TestMethod]
public void Test1()
{
Expand Down
Loading