simple_fixture

odl.util.testutils.simple_fixture(name, params, fmt=None)[source]

Helper to create a pytest fixture using only name and params.

Parameters:
namestr

Name of the parameters used for the ids argument to pytest.fixture.

paramssequence

Values to be taken as parameters in the fixture. They are used as params argument to _pytest.fixtures.fixture. Arguments wrapped in a pytest.skipif decorator are unwrapped for the generation of the test IDs.

fmtstr, optional

Use this format string for the generation of the ids. For each value, the id string is generated as

fmt.format(name=name, value=value)

hence the format string must use {name} and {value}. Default format strings are:

  • " {name}='{value}' " for string parameters,

  • " {name}={value} " for other types.