@@ -468,6 +468,16 @@ def pytest_fixture_plus(scope="function",
468468 # 'name' argument is not supported in this old version, use the __name__ trick.
469469 fixture_func .__name__ = name
470470
471+ # if unpacking is requested, do it first
472+ if unpack_into is not None :
473+ # get the future fixture name if needed
474+ if name is None :
475+ name = fixture_func .__name__
476+
477+ # get caller module to create the symbols
478+ caller_module = get_caller_module (frame_offset = 2 )
479+ _unpack_fixture (caller_module , unpack_into , name )
480+
471481 # (1) Collect all @pytest.mark.parametrize markers (including those created by usage of @cases_data)
472482 parametrizer_marks = get_pytest_parametrize_marks (fixture_func )
473483 if len (parametrizer_marks ) < 1 :
@@ -577,16 +587,6 @@ def _get_arguments(*args, **kwargs):
577587
578588 return args , kwargs
579589
580- # if unpacking is requested, do it here
581- if unpack_into is not None :
582- # get the future fixture name if needed
583- if name is None :
584- name = fixture_func .__name__
585-
586- # get caller module to create the symbols
587- caller_module = get_caller_module (frame_offset = 2 )
588- _unpack_fixture (caller_module , unpack_into , name )
589-
590590 # --Finally create the fixture function, a wrapper of user-provided fixture with the new signature
591591 if not isgeneratorfunction (fixture_func ):
592592 # normal function with return statement
@@ -864,7 +864,7 @@ def _new_fixture(request, **all_fixtures):
864864
865865 # if unpacking is requested, do it here
866866 if unpack_into is not None :
867- _unpack_fixture (caller_module , unpack_into , name )
867+ _unpack_fixture (caller_module , argnames = unpack_into , fixture = name )
868868
869869 return fix
870870
0 commit comments