From 379349d4535bc368a16b57d0dd9fe66795535e03 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Fri, 23 Jan 2026 10:02:07 +0100 Subject: [PATCH] Follow-up cleanup for FixturesTestTrait --- .../MSTestAdapter.PlatformServices/EngineConstants.cs | 5 ----- .../Execution/ClassCleanupManager.cs | 3 +-- .../Execution/TestExecutionManager.cs | 6 ------ 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Adapter/MSTestAdapter.PlatformServices/EngineConstants.cs b/src/Adapter/MSTestAdapter.PlatformServices/EngineConstants.cs index eca1917fb6..3a0efc89b1 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/EngineConstants.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/EngineConstants.cs @@ -35,11 +35,6 @@ internal static class EngineConstants /// internal const string AssemblyFixturesHierarchyClassName = "[Assembly]"; - /// - /// Discover fixtures or not. - /// - internal const string FixturesTestTrait = "FixturesTrait"; - /// /// Assembly initialize. /// diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ClassCleanupManager.cs b/src/Adapter/MSTestAdapter.PlatformServices/Execution/ClassCleanupManager.cs index 750fd6a2ee..b64888c573 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ClassCleanupManager.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Execution/ClassCleanupManager.cs @@ -14,9 +14,8 @@ internal sealed class ClassCleanupManager public ClassCleanupManager(IEnumerable testsToRun) { - IEnumerable runnableTests = testsToRun.Where(t => t.Traits is null || !t.Traits.Any(t => t.Name == EngineConstants.FixturesTestTrait)); _remainingTestCountsByClass = - new(runnableTests.GroupBy(t => t.TestMethod.FullClassName) + new(testsToRun.GroupBy(t => t.TestMethod.FullClassName) .ToDictionary( g => g.Key, g => g.Count())); diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs index b786dd6e01..754862971a 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs @@ -251,12 +251,6 @@ private static bool MatchTestFilter(ITestCaseFilterExpression? filterExpression, if (filterExpression != null && !filterExpression.MatchTestCase(test, p => testMethodFilter.PropertyValueProvider(test, p))) { - // If this is a fixture test, return true. Fixture tests are not filtered out and are always available for the status. - if (test.Traits.Any(t => t.Name == EngineConstants.FixturesTestTrait)) - { - return true; - } - // Skip test if not fitting filter criteria. return false; }