parametrize_from_file.load_parameters
- parametrize_from_file.load_parameters(path, key, *, loaders=None, preprocess=None, schema=None)
Load test parameters from a file.
- Parameters:
path (str, pathlib.Path, list) – The path to the file containing the parameters. Unlike with
@parametrize
, this path is expected to be absolute. If it’s not absolute, it’s interpreted relative to the current working directory.key (str, list) – See:
@parametrize
loaders (dict) – See:
@parametrize
preprocess (collections.abc.Callable) – See:
@parametrize
schema (collections.abc.Callable) – See:
@parametrize
- Returns:
A list of parameter names
A list of
pytest.param
instances
- Return type:
This function does almost the same thing as
@parametrize
, except that instead of decorating a test function, it simply returns the parameters it loads. This might be useful in some unusual situations. For example, you could use this function to load test parameters from a file in order to merge them with parameters derived from some other source and apply them all to the same test function.