Skip to content

Commit 934f90f

Browse files
authored
Follow-up cleanup for FixturesTestTrait (#7281)
1 parent 7ab65c3 commit 934f90f

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

src/Adapter/MSTestAdapter.PlatformServices/EngineConstants.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ internal static class EngineConstants
3535
/// </summary>
3636
internal const string AssemblyFixturesHierarchyClassName = "[Assembly]";
3737

38-
/// <summary>
39-
/// Discover fixtures or not.
40-
/// </summary>
41-
internal const string FixturesTestTrait = "FixturesTrait";
42-
4338
/// <summary>
4439
/// Assembly initialize.
4540
/// </summary>

src/Adapter/MSTestAdapter.PlatformServices/Execution/ClassCleanupManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ internal sealed class ClassCleanupManager
1414

1515
public ClassCleanupManager(IEnumerable<UnitTestElement> testsToRun)
1616
{
17-
IEnumerable<UnitTestElement> runnableTests = testsToRun.Where(t => t.Traits is null || !t.Traits.Any(t => t.Name == EngineConstants.FixturesTestTrait));
1817
_remainingTestCountsByClass =
19-
new(runnableTests.GroupBy(t => t.TestMethod.FullClassName)
18+
new(testsToRun.GroupBy(t => t.TestMethod.FullClassName)
2019
.ToDictionary(
2120
g => g.Key,
2221
g => g.Count()));

src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,6 @@ private static bool MatchTestFilter(ITestCaseFilterExpression? filterExpression,
251251
if (filterExpression != null
252252
&& !filterExpression.MatchTestCase(test, p => testMethodFilter.PropertyValueProvider(test, p)))
253253
{
254-
// If this is a fixture test, return true. Fixture tests are not filtered out and are always available for the status.
255-
if (test.Traits.Any(t => t.Name == EngineConstants.FixturesTestTrait))
256-
{
257-
return true;
258-
}
259-
260254
// Skip test if not fitting filter criteria.
261255
return false;
262256
}

0 commit comments

Comments
 (0)