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:
Returns:

  • A list of parameter names

  • A list of pytest.param instances

Return type:

tuple

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.