parametrize_from_file
Parametrize test functions with values read from config files.
Note that this module itself can be used as an alias for parametrize
, e.g.:
import parametrize_from_file
@parametrize_from_file
def test_my_func(given, expected):
assert my_func(given) == expected
This is the recommended usage if you do not need to import any other names from
the module. If you do need to import other names, the recommendation is
instead to import the module as pff
, e.g.:
import parametrize_from_file as pff
@pff.fixture
def env(request):
return request.param
@pff.parametrize
def test_my_func(given, expected, env):
assert my_func(given) == expected
Functions
|
Read test parameters from a custom file type. |
|
Return a schema function that will apply functions to the given test parameters. |
|
Return a schema function that will add the given default values to test cases. |
|
Prevent parameters from being read from files with the given suffix. |
|
Create a context manager that will check that the specified exception is raised. |
|
Return a schema function that will expect to be given either an error or the specified set of expected values. |
|
Parametrize a fixture function with values read from a config file. |
|
Load test parameters from a file. |
|
Parametrize a test function with values read from a config file. |
|
Return a dictionary containing all public attributes exposed by the given module. |
Classes
|
Evaluate and/or execute snippets of python code, with powerful control over the names available to those snippets. |
Exceptions
|
Raised when unable to find and/or load test parameters. |