Skip to content

Commit 1019649

Browse files
committed
chore: add PR body
1 parent 9d3077e commit 1019649

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

PR_BODY.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Summary
2+
Clarifies that `pytest_generate_tests` is uniquely discovered when defined in test modules and classes, while other hooks must reside in `conftest.py` or plugins. Adds brief cross-links for readers and a tiny self-test to demonstrate the behavior.
3+
4+
Motivation
5+
Users can be confused by hook discovery. This highlights the only exception to the “hooks live in conftest/plugins” rule and points to the relevant sections, reducing friction and support questions.
6+
7+
Changes
8+
- `doc/en/how-to/writing_hook_functions.rst`: Add short note about `pytest_generate_tests` special discovery; link to parametrization docs and hook reference.
9+
- `doc/en/how-to/parametrize.rst`: Add short note in the `pytest_generate_tests` section reinforcing the special discovery.
10+
- `testing/test_pytest_generate_tests_discovery.py`: New pytester-based test showing `pytest_generate_tests` in a test module works, while `pytest_terminal_summary` in a test module is not executed.
11+
12+
Tests
13+
- Verifies `pytest_generate_tests` in a test module parametrizes a test (2 passed).
14+
- Verifies another hook (`pytest_terminal_summary`) in a test module is not executed.
15+
16+
Docs
17+
Minimal “Note:” additions with cross-links, kept focused for easy review.
18+
19+
Notes
20+
No behavior change; documentation and a small test only.
21+
Local pre-commit and tests pass; docs build succeeds.
22+
23+
Related Issue
24+
Closes #13577

0 commit comments

Comments
 (0)