File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -459,13 +459,14 @@ def pytest_fixture_plus(scope="function",
459459 fixtures to create to represent parts of this fixture. See `unpack_fixture` for details.
460460 :param kwargs: other keyword arguments for `@pytest.fixture`
461461 """
462- # Compatibility for the 'name' argument
463- if LooseVersion (pytest .__version__ ) >= LooseVersion ('3.0.0' ):
464- # pytest version supports "name" keyword argument
465- kwargs ['name' ] = name
466- elif name is not None :
467- # 'name' argument is not supported in this old version, use the __name__ trick.
468- fixture_func .__name__ = name
462+ if name is not None :
463+ # Compatibility for the 'name' argument
464+ if LooseVersion (pytest .__version__ ) >= LooseVersion ('3.0.0' ):
465+ # pytest version supports "name" keyword argument
466+ kwargs ['name' ] = name
467+ elif name is not None :
468+ # 'name' argument is not supported in this old version, use the __name__ trick.
469+ fixture_func .__name__ = name
469470
470471 # (1) Collect all @pytest.mark.parametrize markers (including those created by usage of @cases_data)
471472 parametrizer_marks = get_pytest_parametrize_marks (fixture_func )
You can’t perform that action at this time.
0 commit comments