From 570a5183e89b318bccdfc78658269abe7ebb1cba Mon Sep 17 00:00:00 2001 From: Joosboy <219508079+Joosboy@users.noreply.github.com> Date: Sun, 19 Jul 2026 13:54:59 +0530 Subject: [PATCH 1/2] DOC: fix pytest.mark.xfail and pytest.mark.skip reference docs (#10094) --- doc/en/reference/reference.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 644b78668a7..33397ab120d 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -214,7 +214,7 @@ pytest.mark.skip Unconditionally skip a test function. -.. py:function:: pytest.mark.skip(reason=None) +.. py:function:: pytest.mark.skip(reason="unconditional skip") :keyword str reason: Reason why the test function is being skipped. @@ -266,7 +266,7 @@ pytest.mark.xfail Marks a test function as *expected to fail*. -.. py:function:: pytest.mark.xfail(condition=False, *, reason=None, raises=None, run=True, strict=strict_xfail) +.. py:function:: pytest.mark.xfail(condition=None, *, reason=None, raises=None, run=True, strict=strict_xfail) :keyword Union[bool, str] condition: Condition for marking the test function as xfail (``True/False`` or a @@ -277,7 +277,7 @@ Marks a test function as *expected to fail*. :keyword raises: Exception class (or tuple of classes) expected to be raised by the test function; other exceptions will fail the test. Note that subclasses of the classes passed will also result in a match (similar to how the ``except`` statement works). - :type raises: Type[:py:exc:`Exception`] + :type raises: Type[:py:exc:`Exception`] | Tuple[Type[:py:exc:`Exception`], ...] | None :keyword bool run: Whether the test function should actually be executed. If ``False``, the function will always xfail and will From b9c9e30fdbae0ff94cdd060c5cce911f7c800024 Mon Sep 17 00:00:00 2001 From: Joosboy <219508079+Joosboy@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:16:03 +0530 Subject: [PATCH 2/2] Docs: Move collection hooks under Collection hooks in reference docs (#12658) --- doc/en/reference/reference.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 33397ab120d..49a008d2ba2 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -765,6 +765,17 @@ items, delete or otherwise amend the test items: .. hook:: pytest_collection_finish .. autofunction:: pytest_collection_finish +.. hook:: pytest_collectstart +.. autofunction:: pytest_collectstart +.. hook:: pytest_make_collect_report +.. autofunction:: pytest_make_collect_report +.. hook:: pytest_itemcollected +.. autofunction:: pytest_itemcollected +.. hook:: pytest_collectreport +.. autofunction:: pytest_collectreport +.. hook:: pytest_deselected +.. autofunction:: pytest_deselected + Test running (runtest) hooks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -801,16 +812,6 @@ Reporting hooks Session related reporting hooks: -.. hook:: pytest_collectstart -.. autofunction:: pytest_collectstart -.. hook:: pytest_make_collect_report -.. autofunction:: pytest_make_collect_report -.. hook:: pytest_itemcollected -.. autofunction:: pytest_itemcollected -.. hook:: pytest_collectreport -.. autofunction:: pytest_collectreport -.. hook:: pytest_deselected -.. autofunction:: pytest_deselected .. hook:: pytest_report_header .. autofunction:: pytest_report_header .. hook:: pytest_report_collectionfinish