From 10d169f26c508569f8b5500bfd53bc337e99d851 Mon Sep 17 00:00:00 2001 From: Krishna Prasad Date: Sun, 21 Dec 2025 06:08:12 -0800 Subject: [PATCH 1/4] Docs: move collection-reporting hooks under collection hooks (fixes #12658) --- doc/en/reference/reference.rst | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 8b3ae9fec1b..49454b8b8db 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -757,6 +757,19 @@ items, delete or otherwise amend the test items: If this hook is implemented in ``conftest.py`` files, it always receives all collected items, not only those under the ``conftest.py`` where it is implemented. +Hooks for reporting about collection: + +.. 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 + .. autofunction:: pytest_collection_finish Test running (runtest) hooks @@ -795,16 +808,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 From e2fd41f6111421b4cdc31a6653ecff5d9dd0cb88 Mon Sep 17 00:00:00 2001 From: Krishna Prasad Date: Sun, 21 Dec 2025 07:07:27 -0800 Subject: [PATCH 2/4] Add changelog entry for #12658 --- changelog/12658.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/12658.doc.rst diff --git a/changelog/12658.doc.rst b/changelog/12658.doc.rst new file mode 100644 index 00000000000..0fb5deed9f2 --- /dev/null +++ b/changelog/12658.doc.rst @@ -0,0 +1 @@ +Moved collection-reporting hooks in the API reference from the “Reporting hooks” section to the “Collection hooks” section. From 63ef06f77fc53d84fdf99ffc2d0631d8708f7715 Mon Sep 17 00:00:00 2001 From: Krishna Prasad Date: Sun, 21 Dec 2025 08:15:22 -0800 Subject: [PATCH 3/4] Add changelog entry for #12658 --- changelog/12658.doc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/12658.doc.rst b/changelog/12658.doc.rst index 0fb5deed9f2..5dd3239c690 100644 --- a/changelog/12658.doc.rst +++ b/changelog/12658.doc.rst @@ -1 +1 @@ -Moved collection-reporting hooks in the API reference from the “Reporting hooks” section to the “Collection hooks” section. +Moved collection-reporting hooks in the API reference under the Collection hooks section. From 7a3557dc452ceee87ee8210a888e8d3e25879b03 Mon Sep 17 00:00:00 2001 From: Krishna Prasad Date: Sun, 21 Dec 2025 08:53:37 -0800 Subject: [PATCH 4/4] Docs: add changelog entry for #12658 --- changelog/12658.doc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/12658.doc.rst b/changelog/12658.doc.rst index 5dd3239c690..e6c9f128e80 100644 --- a/changelog/12658.doc.rst +++ b/changelog/12658.doc.rst @@ -1 +1 @@ -Moved collection-reporting hooks in the API reference under the Collection hooks section. +Moved collection-reporting hooks in the API reference from “Reporting hooks” to the “Collection hooks” section.