Does not consult files at project root
@DawnofGenX ci sta già lavorando.
Dal 6/10/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Start by reproducing the configuration and .coverage differences from the project root and from ./tests/, using the listed pytest, pytest-cov, and coverage versions. Trace how pytest-cov locates pyproject.toml and chooses the coverage output path; done means both invocations use the project-root configuration and place .coverage consistently.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
If pytest runs in e.g. ./tests/, it reads ../pyproject.toml for configuration options, and that squares with my expectation. pytest-cov does seem to look only for ./pyproject.toml (and also writes ./.coverage instead of keeping that file at the project root), and that causes it to run with different settings depending on where pytest is invoked.
Case in point, I have this in my config:
[tool.coverage.report]
exclude_also = [
'def __repr__',
]
If I run pytest from the project root directory, I get 100% coverage. If I run it from the tests/ subdirectory, all __repr__ functions, which I don't test, get reports as uncovered.
Reproducer
Versions
pytest 8.3.5
pytest-cov 6.1.1
coverage 7.8.0
Python 3.13.3
- Lingua principale
- Python
- Stelle
- 2.1k
- Fork
- 253
- Merge medio
- 12g 4h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytest-dev/pytest-cov
-
Celery tests require package; test blows up if Celery not installed instead of skipping the tests gracefullyForse già presa @dchaudhari7177 l’ha presa 96 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pytest-dev/pytest-cov#750 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pytest-dev/pytest-cov#617 · 1 commento ·
-
Only set dynamic context on coveragepy cores supporting it, perhaps?Forse già presa @terminalchai l’ha presa 10 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
pytest-dev/pytest-cov#755 · 3 commenti ·
-
INTERNALERROR when generating html report using pytest-cov 7.1.0 with jinjaForse già presa @daleselaji-dev l’ha presa 82 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
pytest-dev/pytest-cov#748 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
pytest-dev/pytest-cov#747 · 1 reazione ·
Tutte le issue di pytest-dev/pytest-cov
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
aws-samples/sample-per-model-bedrock#639 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
awslabs/visual-asset-management-system#937 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
project-codeflare/codeflare-sdk#1195 ·
I maintainer di solito rispondono entro 1 giorno
-
Bump numpy dependencyAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
pandas-dev/pandas-stubs#2051 ·
I maintainer di solito rispondono entro 1 giorno