Skip to content

Commit ccddeba

Browse files
committed
Suppress warning in PsesInternalHostTests
While we could put the entire task inside the lambda, thus eliminating the warning, we then lose the ability to assert that the task itself was cancelled. This feels important to be able to do since the exception does not necessarily prove that this explicit task was canceled.
1 parent 2fdae0e commit ccddeba

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/PowerShellEditorServices.Test/Session/PsesInternalHostTests.cs

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ await Assert.ThrowsAsync<TaskCanceledException>(() =>
9494
}
9595

9696
[Fact]
97+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD003:Avoid awaiting foreign Tasks", Justification = "Explicitly checking task cancellation status.")]
9798
public async Task CanCancelExecutionWithMethod()
9899
{
99100
var executeTask = psesHost.ExecutePSCommandAsync(

0 commit comments

Comments
 (0)