Loader: Parameterized Tests

Load tests from parameterized functions and methods.

This plugin implements getTestCaseNames(), loadTestsFromModule(), and loadTestsFromName() to support loading tests from parameterized test functions and methods.

To parameterize a function or test case method, use nose2.tools.params().

To address a particular parameterized test via a command-line test name, append a colon (‘:’) followed by the index, starting from 1, of the case you want to execute.

Configuration [parameters]

always-on
Default :True
Type :boolean

Sample configuration

The default configuration is equivalent to including the following in a unittest.cfg file.

[parameters]
always-on = True

Plugin class reference: Parameters

class nose2.plugins.loader.parameters.Parameters[source]

Loader plugin that loads parameterized tests

getTestCaseNames(event)[source]

Generate test case names for all parameterized methods

loadTestsFromModule(event)[source]

Load tests from parameterized test functions in the module

loadTestsFromName(event)[source]

Load parameterized test named on command line

Table Of Contents

Previous topic

Loader: Test Generators

Next topic

Loader: Test Cases

This Page