Main Content

teardownTestMethod

Class: matlab.unittest.plugins.TestRunnerPlugin
Namespace: matlab.unittest.plugins

Extend tearing down Test method

Description

teardownTestMethod(plugin,pluginData) extends the tearing down of a Test method. This method defines how the test runner performs Test method teardown for a single test suite element. The testing framework evaluates this method within the scope of the runTest method.

example

Input Arguments

expand all

Plugin, specified as a matlab.unittest.plugins.TestRunnerPlugin object.

Test method teardown information, specified as a matlab.unittest.plugins.plugindata.ImplicitFixturePluginData object. The testing framework uses this information to describe the test content to the plugin.

Attributes

Accessprotected

To learn about attributes of methods, see Method Attributes.

Examples

expand all

Create a plugin and override the teardownTestMethod method to display the Test method name at teardown time.

classdef ExamplePlugin < matlab.unittest.plugins.TestRunnerPlugin
    methods (Access=protected)
        function teardownTestMethod(plugin,pluginData)
            fprintf('### Tearing down: %s\n',pluginData.Name)
            teardownTestMethod@ ...
                matlab.unittest.plugins.TestRunnerPlugin(plugin,pluginData)
        end
    end
end

Version History

Introduced in R2014a