Skip to content

test: take the repo root from pytest so the ADR check can run from a fetched copy - #119

Merged
lesnik512 merged 1 commit into
mainfrom
shared-adr-check-rootpath
Sep 27, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
shared-adr-check-rootpath

Conversation

@lesnik512

Copy link
Copy Markdown
Member

What

`test_adr_citations.py` computed the repo root as `Path(file).parent.parent`. It now takes `pytestconfig.rootpath`.

Why

Pilot for replacing the 25 byte-identical copies of this test across the org with a fetch of this file from `main` (first consumer: eof-fixer). A fetched copy lives in a temp directory, so `file` points nowhere useful; `rootpath` is the repo pytest is run for.

For this repo nothing changes: `testpaths = ["tests"]` and the `pyproject.toml` ini section make rootpath the repo root. A consumer runs it as `pytest --rootdir=. `, which gives the same rootpath without pulling in the consumer's `addopts`.

Verified

  • This repo: `uv run pytest`, 132 passed, 29 skipped.
  • Against an eof-fixer checkout via `--rootdir=.`: 7 passed; a planted `docs/adr/0009-nope.md` citation fails with `eof_fixer/_planted.py cites docs/adr/0009-nope.md`.

@lesnik512
lesnik512 merged commit e96c350 into main Sep 27, 2026
3 checks passed
@lesnik512
lesnik512 deleted the shared-adr-check-rootpath branch September 27, 2026 18:48
This was referenced Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant