matlab.unittest.fixtures.TemporaryFolderFixture Class
R2026bNamespace: matlab.unittest.fixtures
Superclasses: matlab.unittest.fixtures.Fixture
Fixture for creating temporary folder
Description
The matlab.unittest.fixtures.TemporaryFolderFixture class provides a fixture for creating a temporary folder.
When the testing framework sets up the fixture, the fixture creates a temporary folder. By
default, when the framework tears down the fixture, the fixture deletes the folder and its
contents. Before deleting the folder, the fixture first clears from memory any functions, MEX
files, and classes that are defined in the temporary folder.
The matlab.unittest.fixtures.TemporaryFolderFixture class is a handle class.
Creation
Description
fixture = matlab.unittest.fixtures.TemporaryFolderFixture
constructs a fixture for creating a temporary folder.
fixture = matlab.unittest.fixtures.TemporaryFolderFixture(
specifies options using one or more name-value arguments. For example, Name=Value)fixture =
matlab.unittest.fixtures.TemporaryFolderFixture(WithSuffix="_FeatureA")
constructs a fixture that creates a temporary folder with the specified suffix for the
folder name.
Name-Value Arguments
Properties
Examples
Tips
Instead of using the
TemporaryFolderFixtureclass, you can use thecreateTemporaryFoldermethod to create a temporary folder for your test. However, more functionality is available when you create a temporary folder using theTemporaryFolderFixtureclass.Both the
TemporaryFolderFixtureandWorkingFolderFixtureclasses create a fixture that results in a temporary folder. However, the fixture created withWorkingFolderFixturealso sets the temporary folder as the current folder.
Version History
Introduced in R2013b