pytest_cases/fixture_parametrize_plus.py
def parametrize_plus(argnames=None,       # type: str
                     argvalues=None,      # type: Iterable[Any]
                     indirect=False,      # type: bool
                     ids=None,            # type: Union[Callable, List[str]]
                     idstyle='explicit',  # type: str
                     idgen=_IDGEN,        # type: Union[str, Callable]
                     scope=None,          # type: str
                     hook=None,           # type: Callable[[Callable], Callable]
                     debug=False,         # type: bool
                     **args):
    """
    Equivalent to `@pytest.mark.parametrize` but also supports

    (1) new alternate style for argnames/argvalues. One can also use `**args` to pass additional `{argnames: argvalues}`
    in the same parametrization call. This can be handy in combination with `idgen` to master the whole id template
    associated with several parameters. Note that you can pass coma-separated argnames too, by de-referencing a dict:
    e.g. `**{'a,b': [(0, True), (1, False)], 'c': [-1, 2]}`.

    (2) new alternate style for ids. One can use `idgen` instead of `ids`. `idgen` can be a callable receiving all
    parameters at once (`**args`) and returning an id ; or it can be a string template using the new-style string
    formatting where the argnames can be used as variables (e.g. `idgen=lambda **args: "a={a}".format(**args)` or
    `idgen="my_id where a={a}"`). The special `idgen=AUTO` symbol can be used to generate a default string template
    equivalent to `lambda **args: "-".join("%s=%s" % (n, v) for n, v in args.items())`. This is enabled by default
    if you use the alternate style for argnames/argvalues (e.g. if `len(args) > 0`).

    (3) new possibilities in argvalues:

     - one can include references to fixtures with `fixture_ref(<fixture>)` where <fixture> can be the fixture name or
       fixture function. When such a fixture reference is detected in the argvalues, a new function-scope "union" fixture
       will be created with a unique name, and the test function will be wrapped so as to be injected with the correct
       parameters from this fixture. Special test ids will be created to illustrate the switching between the various
       normal parameters and fixtures. You can see debug print messages about all fixtures created using `debug=True`

     - one can include lazy argvalues with `lazy_value(<valuegetter>, [id=..., marks=...])`. A `lazy_value` is the same
       thing than a function-scoped fixture, except that the value getter function is not a fixture and therefore can
       neither be parametrized nor depend on fixtures. It should have no mandatory argument.

    Both `fixture_ref` and `lazy_value` can be used to represent a single argvalue, or a whole tuple of argvalues when
    there are several argnames. Several of them can be used in a tuple.

    Finally, `pytest.param` is supported even when there are `fixture_ref` and `lazy_value`.

    An optional `hook` can be passed, to apply on each fixture function that is created during this call. The hook
    function will be called everytime a fixture is about to be created. It will receive a  single argument (the
    function implementing the fixture) and should return the function to use. For example you can use `saved_fixture`
    from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.

    :param argnames: same as in pytest.mark.parametrize
    :param argvalues: same as in pytest.mark.parametrize except that `fixture_ref` and `lazy_value` are supported
    :param indirect: same as in pytest.mark.parametrize
    :param ids: same as in pytest.mark.parametrize. Note that an alternative way to create ids exists with `idgen`. Only
        one non-None `ids` or `idgen should be provided.
    :param idgen: an id formatter. Either a string representing a template, or a callable receiving all argvalues
        at once (as opposed to the behaviour in pytest ids). This alternative way to generate ids can only be used when
        `ids` is not provided (None).
    :param idstyle: style of ids to be used in generated "union" fixtures. See `fixture_union` for details.
    :param scope: same as in pytest.mark.parametrize
    :param hook: an optional hook to apply to each fixture function that is created during this call. The hook function
        will be called everytime a fixture is about to be created. It will receive a single argument (the function
        implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from
        `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
    :param debug: print debug messages on stdout to analyze fixture creation (use pytest -s to see them)
    :param args: additional {argnames: argvalues} definition
    :return:
    """
    return _parametrize_plus(argnames, argvalues, indirect=indirect, ids=ids, idgen=idgen, idstyle=idstyle, scope=scope,
                             hook=hook, debug=debug, **args)

    Equivalent to `@pytest.mark.parametrize` but also supports

    (1) new alternate style for argnames/argvalues. One can also use `**args` to pass additional `{argnames: argvalues}`
    in the same parametrization call. This can be handy in combination with `idgen` to master the whole id template
    associated with several parameters. Note that you can pass coma-separated argnames too, by de-referencing a dict:
    e.g. `**{'a,b': [(0, True), (1, False)], 'c': [-1, 2]}`.

    (2) new alternate style for ids. One can use `idgen` instead of `ids`. `idgen` can be a callable receiving all
    parameters at once (`**args`) and returning an id ; or it can be a string template using the new-style string
    formatting where the argnames can be used as variables (e.g. `idgen=lambda **args: "a={a}".format(**args)` or
    `idgen="my_id where a={a}"`). The special `idgen=AUTO` symbol can be used to generate a default string template
    equivalent to `lambda **args: "-".join("%s=%s" % (n, v) for n, v in args.items())`. This is enabled by default
    if you use the alternate style for argnames/argvalues (e.g. if `len(args) > 0`).

    (3) new possibilities in argvalues:

     - one can include references to fixtures with `fixture_ref(<fixture>)` where <fixture> can be the fixture name or
       fixture function. When such a fixture reference is detected in the argvalues, a new function-scope "union" fixture
       will be created with a unique name, and the test function will be wrapped so as to be injected with the correct
       parameters from this fixture. Special test ids will be created to illustrate the switching between the various
       normal parameters and fixtures. You can see debug print messages about all fixtures created using `debug=True`

     - one can include lazy argvalues with `lazy_value(<valuegetter>, [id=..., marks=...])`. A `lazy_value` is the same
       thing than a function-scoped fixture, except that the value getter function is not a fixture and therefore can
       neither be parametrized nor depend on fixtures. It should have no mandatory argument.

    Both `fixture_ref` and `lazy_value` can be used to represent a single argvalue, or a whole tuple of argvalues when
    there are several argnames. Several of them can be used in a tuple.

    Finally, `pytest.param` is supported even when there are `fixture_ref` and `lazy_value`.

    An optional `hook` can be passed, to apply on each fixture function that is created during this call. The hook
    function will be called everytime a fixture is about to be created. It will receive a  single argument (the
    function implementing the fixture) and should return the function to use. For example you can use `saved_fixture`
    from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.

    :param argnames: same as in pytest.mark.parametrize
    :param argvalues: same as in pytest.mark.parametrize except that `fixture_ref` and `lazy_value` are supported
    :param indirect: same as in pytest.mark.parametrize
    :param ids: same as in pytest.mark.parametrize. Note that an alternative way to create ids exists with `idgen`. Only
        one non-None `ids` or `idgen should be provided.
    :param idgen: an id formatter. Either a string representing a template, or a callable receiving all argvalues
        at once (as opposed to the behaviour in pytest ids). This alternative way to generate ids can only be used when
        `ids` is not provided (None).
    :param idstyle: style of ids to be used in generated "union" fixtures. See `fixture_union` for details.
    :param scope: same as in pytest.mark.parametrize
    :param hook: an optional hook to apply to each fixture function that is created during this call. The hook function
        will be called everytime a fixture is about to be created. It will receive a single argument (the function
        implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from
        `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
    :param debug: print debug messages on stdout to analyze fixture creation (use pytest -s to see them)
    :param args: additional {argnames: argvalues} definition
    :return:
    
Equivalent to `@pytest.mark.parametrize` but also supports
(1) new alternate style for argnames/argvalues. One can also use `**args` to pass additional `{argnames: argvalues}`
in the same parametrization call. This can be handy in combination with `idgen` to master the whole id template
associated with several parameters. Note that you can pass coma-separated argnames too, by de-referencing a dict:
e.g.

(2) new alternate style for ids. One can use `idgen` instead of `ids`.

(3) new possibilities in argvalues.

one can include references to fixtures with `fixture_ref()` where  can be the fixture name or
fixture function. When such a fixture reference is detected in the argvalues, a new function-scope "union" fixture
will be created with a unique name, and the test function will be wrapped so as to be injected with the correct
parameters from this fixture. Special test ids will be created to illustrate the switching between the various
normal parameters and fixtures. You can see debug print messages about all fixtures created using `debug=True`

one can include lazy argvalues with `lazy_value(, [id=..., marks=...])`. A `lazy_value` is the same
thing than a function-scoped fixture, except that the value getter function is not a fixture and therefore can
neither be parametrized nor depend on fixtures. It should have no mandatory argument.

Both `fixture_ref` and `lazy_value` can be used to represent a single argvalue, or a whole tuple of argvalues when
there are several argnames. Several of them can be used in a tuple.



An optional `hook` can be passed, to apply on each fixture function that is created during this call. The hook
function will be called everytime a fixture is about to be created. It will receive a  single argument (the
function implementing the fixture) and should return the function to use. For example you can use `saved_fixture`
from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
Equivalent to ` @pytest . mark . parametrize ` but also supports ( 1 ) new alternate style for argnames / argvalues . One can also use ` ** args ` to pass additional ` { argnames : argvalues } ` in the same parametrization call . This can be handy in combination with ` idgen ` to master the whole id template associated with several parameters . Note that you can pass coma - separated argnames too by de - referencing a dict : e . g . ( 2 ) new alternate style for ids . One can use ` idgen ` instead of ` ids ` . ( 3 ) new possibilities in argvalues . one can include references to fixtures with ` fixture_ref () ` where can be the fixture name or fixture function . When such a fixture reference is detected in the argvalues a new function - scope " union " fixture will be created with a unique name and the test function will be wrapped so as to be injected with the correct parameters from this fixture . Special test ids will be created to illustrate the switching between the various normal parameters and fixtures . You can see debug print messages about all fixtures created using ` debug = True ` one can include lazy argvalues with ` lazy_value ( [ id = ... marks = ... ] ) ` . A ` lazy_value ` is the same thing than a function - scoped fixture except that the value getter function is not a fixture and therefore can neither be parametrized nor depend on fixtures . It should have no mandatory argument . Both ` fixture_ref ` and ` lazy_value ` can be used to represent a single argvalue or a whole tuple of argvalues when there are several argnames . Several of them can be used in a tuple . An optional ` hook ` can be passed to apply on each fixture function that is created during this call . The hook function will be called everytime a fixture is about to be created . It will receive a single argument ( the function implementing the fixture ) and should return the function to use . For example you can use ` saved_fixture ` from ` pytest - harvest ` as a hook in order to save all such created fixtures in the fixture store .
def parametrize_plus(argnames=None,       
                     argvalues=None,      
                     indirect=False,      
                     ids=None,            
                     idstyle='explicit',  
                     idgen=_IDGEN,        
                     scope=None,          
                     hook=None,           
                     debug=False,         
                     **args):
    return _parametrize_plus(argnames, argvalues, indirect=indirect, ids=ids, idgen=idgen, idstyle=idstyle, scope=scope,
                             hook=hook, debug=debug, **args)
def parametrize_plus ( argnames = None , argvalues = None , indirect = False , ids = None , idstyle = 'explicit' , idgen = _IDGEN , scope = None , hook = None , debug = False , ** args ) : return _parametrize_plus ( argnames , argvalues , indirect = indirect , ids = ids , idgen = idgen , idstyle = idstyle , scope = scope , hook = hook , debug = debug , ** args )
Equivalent to `@pytest.mark.parametrize` but also supports
(1) new alternate style for argnames/argvalues.
Equivalent to ` @pytest . mark . parametrize ` but also supports ( 1 ) new alternate style for argnames / argvalues .
# type: str # type: Iterable[Any] # type: bool # type: Union[Callable, List[str]] # type: str # type: Union[str, Callable] # type: str # type: Callable[[Callable], Callable] # type: bool """
    Equivalent to `@pytest.mark.parametrize` but also supports

    (1) new alternate style for argnames/argvalues. One can also use `**args` to pass additional `{argnames: argvalues}`
    in the same parametrization call. This can be handy in combination with `idgen` to master the whole id template
    associated with several parameters. Note that you can pass coma-separated argnames too, by de-referencing a dict:
    e.g. `**{'a,b': [(0, True), (1, False)], 'c': [-1, 2]}`.

    (2) new alternate style for ids. One can use `idgen` instead of `ids`. `idgen` can be a callable receiving all
    parameters at once (`**args`) and returning an id ; or it can be a string template using the new-style string
    formatting where the argnames can be used as variables (e.g. `idgen=lambda **args: "a={a}".format(**args)` or
    `idgen="my_id where a={a}"`). The special `idgen=AUTO` symbol can be used to generate a default string template
    equivalent to `lambda **args: "-".join("%s=%s" % (n, v) for n, v in args.items())`. This is enabled by default
    if you use the alternate style for argnames/argvalues (e.g. if `len(args) > 0`).

    (3) new possibilities in argvalues:

     - one can include references to fixtures with `fixture_ref(<fixture>)` where <fixture> can be the fixture name or
       fixture function. When such a fixture reference is detected in the argvalues, a new function-scope "union" fixture
       will be created with a unique name, and the test function will be wrapped so as to be injected with the correct
       parameters from this fixture. Special test ids will be created to illustrate the switching between the various
       normal parameters and fixtures. You can see debug print messages about all fixtures created using `debug=True`

     - one can include lazy argvalues with `lazy_value(<valuegetter>, [id=..., marks=...])`. A `lazy_value` is the same
       thing than a function-scoped fixture, except that the value getter function is not a fixture and therefore can
       neither be parametrized nor depend on fixtures. It should have no mandatory argument.

    Both `fixture_ref` and `lazy_value` can be used to represent a single argvalue, or a whole tuple of argvalues when
    there are several argnames. Several of them can be used in a tuple.

    Finally, `pytest.param` is supported even when there are `fixture_ref` and `lazy_value`.

    An optional `hook` can be passed, to apply on each fixture function that is created during this call. The hook
    function will be called everytime a fixture is about to be created. It will receive a  single argument (the
    function implementing the fixture) and should return the function to use. For example you can use `saved_fixture`
    from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.

    :param argnames: same as in pytest.mark.parametrize
    :param argvalues: same as in pytest.mark.parametrize except that `fixture_ref` and `lazy_value` are supported
    :param indirect: same as in pytest.mark.parametrize
    :param ids: same as in pytest.mark.parametrize. Note that an alternative way to create ids exists with `idgen`. Only
        one non-None `ids` or `idgen should be provided.
    :param idgen: an id formatter. Either a string representing a template, or a callable receiving all argvalues
        at once (as opposed to the behaviour in pytest ids). This alternative way to generate ids can only be used when
        `ids` is not provided (None).
    :param idstyle: style of ids to be used in generated "union" fixtures. See `fixture_union` for details.
    :param scope: same as in pytest.mark.parametrize
    :param hook: an optional hook to apply to each fixture function that is created during this call. The hook function
        will be called everytime a fixture is about to be created. It will receive a single argument (the function
        implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from
        `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
    :param debug: print debug messages on stdout to analyze fixture creation (use pytest -s to see them)
    :param args: additional {argnames: argvalues} definition
    :return:
    """
None
argnames
same as in pytest.mark.parametrize
same as in pytest . mark . parametrize
argvalues
same as in pytest.mark.parametrize except that `fixture_ref` and `lazy_value` are supported
same as in pytest . mark . parametrize except that ` fixture_ref ` and ` lazy_value ` are supported
indirect
same as in pytest.mark.parametrize
same as in pytest . mark . parametrize
ids
same as in pytest.mark.parametrize. Note that an alternative way to create ids exists with `idgen`. Only
one non-None `ids` or `idgen should be provided.
same as in pytest . mark . parametrize . Note that an alternative way to create ids exists with ` idgen ` . Only one non - None ` ids ` or ` idgen should be provided .
idstyle
style of ids to be used in generated "union" fixtures. See `fixture_union` for details.
style of ids to be used in generated " union " fixtures . See ` fixture_union ` for details .
idgen
an id formatter. Either a string representing a template, or a callable receiving all argvalues
at once (as opposed to the behaviour in pytest ids). This alternative way to generate ids can only be used when
`ids` is not provided (None).
an id formatter . Either a string representing a template or a callable receiving all argvalues at once ( as opposed to the behaviour in pytest ids ) . This alternative way to generate ids can only be used when ` ids ` is not provided ( None ) .
scope
same as in pytest.mark.parametrize
same as in pytest . mark . parametrize
hook
an optional hook to apply to each fixture function that is created during this call. The hook function
will be called everytime a fixture is about to be created. It will receive a single argument (the function
implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from
`pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
an optional hook to apply to each fixture function that is created during this call . The hook function will be called everytime a fixture is about to be created . It will receive a single argument ( the function implementing the fixture ) and should return the function to use . For example you can use ` saved_fixture ` from ` pytest - harvest ` as a hook in order to save all such created fixtures in the fixture store .
debug
print debug messages on stdout to analyze fixture creation (use pytest -s to see them)
print debug messages on stdout to analyze fixture creation ( use pytest - s to see them )
args
additional {argnames: argvalues} definition
additional { argnames : argvalues } definition