Table of Contents

Method OnTestMethodCleanupFailure

Namespace
Xunit.v3
Assembly
xunit.v3.core.dll

OnTestMethodCleanupFailure(TContext, Exception)

This method is called when an exception was thrown while cleaning up, after the test method has run. By default, this sends TestMethodCleanupFailure.

protected virtual ValueTask<bool> OnTestMethodCleanupFailure(TContext ctxt, Exception exception)

Parameters

ctxt TContext

The context that describes the current test method

exception Exception

The exception that caused the cleanup failure (may be an instance of AggregateException if more than one exception occurred).

Returns

ValueTask<bool>

Return true if test execution should continue; false if it should be shut down.

Remarks

This method runs during CleaningUp and any exceptions thrown are converted into fatal exception messages (via IErrorMessage) and sent to the message bus in ctxt.