3232from .fixture__creation import check_name_available , CHANGE , WARN
3333from .fixture_core1_unions import InvalidParamsList , NOT_USED , UnionFixtureAlternative , _make_fixture_union , \
3434 _make_unpack_fixture , UnionIdMakers
35- from .fixture_core2 import _create_param_fixture , fixture_plus
35+ from .fixture_core2 import _create_param_fixture , fixture
3636
3737
3838def _fixture_product (fixtures_dest ,
@@ -102,8 +102,8 @@ def _new_fixture(request, **all_fixtures):
102102 _new_fixture .__name__ = name
103103
104104 # finally create the fixture per se.
105- # WARNING we do not use pytest.fixture but fixture_plus so that NOT_USED is discarded
106- f_decorator = fixture_plus (scope = scope , autouse = autouse , hook = hook , ** kwargs )
105+ # WARNING we do not use pytest.fixture but fixture so that NOT_USED is discarded
106+ f_decorator = fixture (scope = scope , autouse = autouse , hook = hook , ** kwargs )
107107 fix = f_decorator (_new_fixture )
108108
109109 # Dynamically add fixture to caller's module as explained in https://github.com/pytest-dev/pytest/issues/2424
@@ -123,7 +123,7 @@ def _new_fixture(request, **all_fixtures):
123123
124124class fixture_ref (object ): # noqa
125125 """
126- A reference to a fixture, to be used in `@parametrize_plus `.
126+ A reference to a fixture, to be used in `@parametrize `.
127127 You can create it from a fixture name or a fixture object (function).
128128 """
129129 __slots__ = 'fixture' , 'theoretical_size' , '_id'
@@ -199,13 +199,16 @@ def __repr__(self):
199199@pytest .hookimpl (optionalhook = True )
200200def pytest_parametrize_plus (* args ,
201201 ** kwargs ):
202- warn ("`pytest_parametrize_plus` is deprecated. Please use the new alias `parametrize_plus `. "
202+ warn ("`pytest_parametrize_plus` and `parametrize_plus` are deprecated. Please use the new alias `parametrize `. "
203203 "See https://github.com/pytest-dev/pytest/issues/6475" , category = DeprecationWarning , stacklevel = 2 )
204- return parametrize_plus (* args , ** kwargs )
204+ return parametrize (* args , ** kwargs )
205+
206+
207+ parametrize_plus = pytest_parametrize_plus
205208
206209
207210class ParamAlternative (UnionFixtureAlternative ):
208- """Defines an "alternative", used to parametrize a fixture union in the context of parametrize_plus
211+ """Defines an "alternative", used to parametrize a fixture union in the context of parametrize
209212
210213 It is similar to a union fixture alternative, except that it also remembers the parameter argnames.
211214 They are used to generate the test id corresponding to this alternative. See `_get_minimal_id` implementations.
@@ -593,17 +596,17 @@ def nostyle(cls,
593596_IDGEN = object ()
594597
595598
596- def parametrize_plus (argnames = None , # type: str
597- argvalues = None , # type: Iterable[Any]
598- indirect = False , # type: bool
599- ids = None , # type: Union[Callable, Iterable[str]]
600- idstyle = None , # type: Union[str, Callable]
601- idgen = _IDGEN , # type: Union[str, Callable]
602- auto_refs = True , # type: bool
603- scope = None , # type: str
604- hook = None , # type: Callable[[Callable], Callable]
605- debug = False , # type: bool
606- ** args ):
599+ def parametrize (argnames = None , # type: str
600+ argvalues = None , # type: Iterable[Any]
601+ indirect = False , # type: bool
602+ ids = None , # type: Union[Callable, Iterable[str]]
603+ idstyle = None , # type: Union[str, Callable]
604+ idgen = _IDGEN , # type: Union[str, Callable]
605+ auto_refs = True , # type: bool
606+ scope = None , # type: str
607+ hook = None , # type: Callable[[Callable], Callable]
608+ debug = False , # type: bool
609+ ** args ):
607610 """
608611 Equivalent to `@pytest.mark.parametrize` but also supports
609612
@@ -918,7 +921,7 @@ def parametrize_plus_decorate(test_func, fixtures_dest):
918921 main_fixture_style_template = "%s_%s"
919922 fixture_union_name = main_fixture_style_template % (test_func_name , param_names_str )
920923 fixture_union_name = check_name_available (fixtures_dest , fixture_union_name , if_name_exists = CHANGE ,
921- caller = parametrize_plus )
924+ caller = parametrize )
922925
923926 # Retrieve (if ref) or create (for normal argvalues) the fixtures that we will union
924927 fixture_alternatives = []
@@ -984,7 +987,7 @@ def parametrize_plus_decorate(test_func, fixtures_dest):
984987 _idstyle = idstyle
985988
986989 # note: the function automatically registers it in the module
987- _make_fixture_union (fixtures_dest , name = fixture_union_name , hook = hook , caller = parametrize_plus ,
990+ _make_fixture_union (fixtures_dest , name = fixture_union_name , hook = hook , caller = parametrize ,
988991 fix_alternatives = fixture_alternatives , unique_fix_alt_names = fix_alt_names ,
989992 idstyle = _idstyle , scope = scope )
990993
0 commit comments