Commit 6890312
committed
docs(_ext[sphinx_pytest_fixtures]): explicit :kind: option; deprecate heuristics (B5)
why: _is_factory and _is_overridable were fragile heuristics — uppercase-first
name and docstring keyword scanning. Authors writing manual .. py:fixture::
blocks had no way to set the kind explicitly.
what:
- Add _infer_kind(obj, explicit_kind) with priority chain: explicit :kind:
option > type annotation (factory) > heuristic (override_hook) > resource
- Add "kind" to PyFixtureDirective.option_spec so :kind: override_hook works
in RST source
- Render kind as a "Kind" field in transform_content when non-default
- Route add_directive_header through _infer_kind instead of emitting
bare :factory: / :overridable: flags
- Keep _is_factory and _is_overridable as internal helpers (used by
_infer_kind); all 10 integration tests now pass including
test_kind_override_hook_option1 parent 86e5b1b commit 6890312
1 file changed
Lines changed: 45 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
393 | 425 | | |
394 | 426 | | |
395 | 427 | | |
| |||
415 | 447 | | |
416 | 448 | | |
417 | 449 | | |
| 450 | + | |
418 | 451 | | |
419 | 452 | | |
420 | 453 | | |
| |||
511 | 544 | | |
512 | 545 | | |
513 | 546 | | |
| 547 | + | |
514 | 548 | | |
515 | 549 | | |
516 | 550 | | |
| |||
521 | 555 | | |
522 | 556 | | |
523 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
524 | 566 | | |
525 | 567 | | |
526 | 568 | | |
| |||
713 | 755 | | |
714 | 756 | | |
715 | 757 | | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
720 | 761 | | |
721 | 762 | | |
722 | 763 | | |
| |||
0 commit comments