Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Does not consult files at project root

Abierto
#692 1 comentario 1 reacción 0 asignados Ver en GitHub

@DawnofGenX ya está trabajando en esto.

Desde el 6/10/2026.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
testing-qa

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
2.1k
Forks
253
Merge medio
12 d 4 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pytest-dev/pytest-cov

Todos los issues de pytest-dev/pytest-cov

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.