Skip to content

Commit 518e965

Browse files
derek73claude
andcommitted
docs: correct AGENTS.md note on which doctests actually run
The note claimed docs/usage.rst doctests run under 'uv run pytest', but testpaths is tests+nameparser only and there is no --doctest-glob, so .rst doctests run under neither pytest nor CI (CI does sphinx -b html, not -b doctest). Document how to verify .rst examples manually and flag the pre-existing customize.rst failures. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8cb62a9 commit 518e965

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Each named attribute (`title`, `first`, etc.) is a `@property` that joins its co
116116

117117
**`lc()` strips only trailing periods**`'M.D.'``'m.d'`, not `'md'`. Exception keys in `capitalization_exceptions` are dot-free, so lookups must also try `.replace('.', '')`.
118118

119-
**`docs/usage.rst` contains live doctests** — edits can break `uv run pytest` (run via `--doctest-modules`). Verify new examples with `python3 -c "..."` before committing.
119+
**Doctests** — docstring examples in `nameparser/*.py` run under `uv run pytest` (`--doctest-modules`; `testpaths` is `tests` + `nameparser` only). The `.rst` doctests in `docs/` (`usage.rst`, `customize.rst`) are **not** run by pytest or CI (CI does `sphinx-build -b html`, not `-b doctest`), so verify `.rst` examples manually: `python3 -c "import doctest; print(doctest.testfile('docs/usage.rst', module_relative=False, optionflags=doctest.NORMALIZE_WHITESPACE))"`. Note `customize.rst` has pre-existing failures under `-b doctest` (CONSTANTS state leaks across examples — no per-example reset like `tests/conftest.py` provides — plus non-deterministic `SetManager` repr).
120120

121121
**`initials_separator` is intra-group only** — it controls the joiner between consecutive initials *within* a name group (e.g. two middle names in `middle_list`). Spaces *between* groups come from `initials_format`. To fully concatenate initials you need both `initials_separator=""` and `initials_format="{first}{middle}{last}"`.
122122

0 commit comments

Comments
 (0)