From 56f71f3842c6b424473e1663dd7c815c20f36bdc Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 4 Dec 2024 18:48:36 -0800 Subject: [PATCH] Second location where PreEnumerateTheories needs to be turned off for #426 --- src/xunit.runner.visualstudio/VsTestRunner.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xunit.runner.visualstudio/VsTestRunner.cs b/src/xunit.runner.visualstudio/VsTestRunner.cs index cb0a82d..0e90c05 100644 --- a/src/xunit.runner.visualstudio/VsTestRunner.cs +++ b/src/xunit.runner.visualstudio/VsTestRunner.cs @@ -489,6 +489,10 @@ async Task RunTestsInAssembly( if (assemblyFileName is null) return; + // Pre-enumerate theories by default, so that we can see all traits, including those that come from + // ITheoryDataRow in v3. See: https://github.com/xunit/visualstudio.xunit/issues/426 + runInfo.Assembly.Configuration.PreEnumerateTheories ??= true; + var configuration = runInfo.Assembly.Configuration; using var _ = AssemblyHelper.SubscribeResolveForAssembly(assemblyFileName, new DiagnosticMessageSink(logger, showDiagnostics: configuration.DiagnosticMessagesOrDefault, showInternalDiagnostics: configuration.DiagnosticMessagesOrDefault));