From 53e1ddfa4824392cf157d6bfc165e7b98af4d8e5 Mon Sep 17 00:00:00 2001 From: Louis Deconinck Date: Thu, 10 Sep 2026 20:11:51 +0200 Subject: [PATCH 1/7] docs: group collection reporting hooks Move collection lifecycle reporting hooks into the collection hooks section so plugin authors can find them with the phase they describe. Fixes #12658 Co-authored-by: OpenAI Codex Signed-off-by: Louis Deconinck --- 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 41dd956842f..70af5288002 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -765,6 +765,19 @@ items, delete or otherwise amend the test items: .. hook:: pytest_collection_finish .. autofunction:: pytest_collection_finish +Collection 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 + Test running (runtest) hooks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -805,16 +818,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 ec2213acf27be7b720589fadc5fde59c59ea9c99 Mon Sep 17 00:00:00 2001 From: Louis Deconinck Date: Thu, 10 Sep 2026 20:13:36 +0200 Subject: [PATCH 2/7] docs: add changelog entry for hook grouping Record the documentation correction in the release history. Co-authored-by: OpenAI Codex Signed-off-by: Louis Deconinck --- 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 edf9d4cb48c..57e93ad1bd5 100644 --- a/changelog/12658.doc.rst +++ b/changelog/12658.doc.rst @@ -1 +1 @@ -Moved the fixture setup and finalizer hooks to the test running hooks section in the reference documentation. +Grouped collection reporting hooks with the other collection hooks in the reference documentation. From adc096796e2e51ba2c98fb49fa50b86b4c7ecf06 Mon Sep 17 00:00:00 2001 From: Louis Deconinck Date: Thu, 10 Sep 2026 20:14:09 +0200 Subject: [PATCH 3/7] docs: preserve the existing hook changelog Keep the earlier #12658 release note while adding the collection-hook correction. Co-authored-by: OpenAI Codex Signed-off-by: Louis Deconinck --- changelog/12658.doc.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog/12658.doc.rst b/changelog/12658.doc.rst index 57e93ad1bd5..1ebc48d2dae 100644 --- a/changelog/12658.doc.rst +++ b/changelog/12658.doc.rst @@ -1 +1,3 @@ +Moved the fixture setup and finalizer hooks to the test running hooks section in the reference documentation. + Grouped collection reporting hooks with the other collection hooks in the reference documentation. From 4fde9a5cc55f7c684982301f30bd445ac3e7c258 Mon Sep 17 00:00:00 2001 From: Louis Deconinck Date: Thu, 10 Sep 2026 20:15:23 +0200 Subject: [PATCH 4/7] docs: add a new history fragment Keep the existing issue fragment unchanged and record this documentation-only PR separately. Co-authored-by: OpenAI Codex Signed-off-by: Louis Deconinck --- changelog/12658.doc.rst | 2 -- changelog/15000.doc.rst | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 changelog/15000.doc.rst diff --git a/changelog/12658.doc.rst b/changelog/12658.doc.rst index 1ebc48d2dae..edf9d4cb48c 100644 --- a/changelog/12658.doc.rst +++ b/changelog/12658.doc.rst @@ -1,3 +1 @@ Moved the fixture setup and finalizer hooks to the test running hooks section in the reference documentation. - -Grouped collection reporting hooks with the other collection hooks in the reference documentation. diff --git a/changelog/15000.doc.rst b/changelog/15000.doc.rst new file mode 100644 index 00000000000..57e93ad1bd5 --- /dev/null +++ b/changelog/15000.doc.rst @@ -0,0 +1 @@ +Grouped collection reporting hooks with the other collection hooks in the reference documentation. From 0d4bfd716176cd26ad93a943318181de1460a663 Mon Sep 17 00:00:00 2001 From: Louis Deconinck Date: Sun, 13 Sep 2026 23:38:20 +0200 Subject: [PATCH 5/7] docs: fold the collection-hooks fragment into 12658.doc.rst Both release notes describe the same issue; name the fragment after the issue rather than the PR. --- changelog/12658.doc.rst | 2 ++ changelog/15000.doc.rst | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 changelog/15000.doc.rst diff --git a/changelog/12658.doc.rst b/changelog/12658.doc.rst index edf9d4cb48c..1ebc48d2dae 100644 --- a/changelog/12658.doc.rst +++ b/changelog/12658.doc.rst @@ -1 +1,3 @@ Moved the fixture setup and finalizer hooks to the test running hooks section in the reference documentation. + +Grouped collection reporting hooks with the other collection hooks in the reference documentation. diff --git a/changelog/15000.doc.rst b/changelog/15000.doc.rst deleted file mode 100644 index 57e93ad1bd5..00000000000 --- a/changelog/15000.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Grouped collection reporting hooks with the other collection hooks in the reference documentation. From 2f74733792d20af8748dfd3a7ad5432c1f155e5e Mon Sep 17 00:00:00 2001 From: Louis Deconinck Date: Mon, 14 Sep 2026 08:08:40 +0200 Subject: [PATCH 6/7] docs: add changelog entry for hook grouping Chronographer requires a fragment added by the PR; name it after the PR number since 12658.doc.rst already exists on main. --- changelog/12658.doc.rst | 2 -- changelog/15000.doc.rst | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 changelog/15000.doc.rst diff --git a/changelog/12658.doc.rst b/changelog/12658.doc.rst index 1ebc48d2dae..edf9d4cb48c 100644 --- a/changelog/12658.doc.rst +++ b/changelog/12658.doc.rst @@ -1,3 +1 @@ Moved the fixture setup and finalizer hooks to the test running hooks section in the reference documentation. - -Grouped collection reporting hooks with the other collection hooks in the reference documentation. diff --git a/changelog/15000.doc.rst b/changelog/15000.doc.rst new file mode 100644 index 00000000000..57e93ad1bd5 --- /dev/null +++ b/changelog/15000.doc.rst @@ -0,0 +1 @@ +Grouped collection reporting hooks with the other collection hooks in the reference documentation. From 06fd86a247b957be94fed114de7a6b5374da6919 Mon Sep 17 00:00:00 2001 From: Louis Deconinck Date: Tue, 15 Sep 2026 09:05:56 +0200 Subject: [PATCH 7/7] docs: name the changelog fragment after issue 12658 12658.doc.rst already exists on main from an earlier change for the same issue, so add the counter suffix per towncrier convention. --- changelog/{15000.doc.rst => 12658.doc.1.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{15000.doc.rst => 12658.doc.1.rst} (100%) diff --git a/changelog/15000.doc.rst b/changelog/12658.doc.1.rst similarity index 100% rename from changelog/15000.doc.rst rename to changelog/12658.doc.1.rst