Added hook to plugin docs and new CHANGELOG record
This commit is contained in:
parent
b9faf78d51
commit
53429ed8b8
|
@ -27,7 +27,8 @@
|
|||
whether to filter the traceback based on the ``ExceptionInfo`` object passed
|
||||
to it.
|
||||
|
||||
*
|
||||
* New ``pytest_make_parametrize_id`` hook.
|
||||
Thanks `@palaviv`_ for the PR.
|
||||
|
||||
**Changes**
|
||||
|
||||
|
|
|
@ -133,12 +133,6 @@ def pytest_deselected(items):
|
|||
def pytest_make_collect_report(collector):
|
||||
""" perform ``collector.collect()`` and return a CollectReport. """
|
||||
|
||||
@hookspec(firstresult=True)
|
||||
def pytest_make_parametrize_id(val):
|
||||
"""Return a user-friendly string representation of the given ``val`` that will be used
|
||||
by @pytest.mark.parametrize calls. Return None if the hook doesn't know about ``val``.
|
||||
"""
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Python test function related hooks
|
||||
# -------------------------------------------------------------------------
|
||||
|
@ -162,6 +156,12 @@ def pytest_pyfunc_call(pyfuncitem):
|
|||
def pytest_generate_tests(metafunc):
|
||||
""" generate (multiple) parametrized calls to a test function."""
|
||||
|
||||
@hookspec(firstresult=True)
|
||||
def pytest_make_parametrize_id(val):
|
||||
"""Return a user-friendly string representation of the given ``val`` that will be used
|
||||
by @pytest.mark.parametrize calls. Return None if the hook doesn't know about ``val``.
|
||||
"""
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# generic runtest related hooks
|
||||
# -------------------------------------------------------------------------
|
||||
|
|
|
@ -470,6 +470,7 @@ you can use the following hook:
|
|||
|
||||
.. autofunction:: pytest_pycollect_makeitem
|
||||
.. autofunction:: pytest_generate_tests
|
||||
.. autofunction:: pytest_make_parametrize_id
|
||||
|
||||
After collection is complete, you can modify the order of
|
||||
items, delete or otherwise amend the test items:
|
||||
|
|
Loading…
Reference in New Issue