Celery tests require package; test blows up if Celery not installed instead of skipping the tests gracefully
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Inizia da tests/test_pytest_cov.py, intorno a test_celery, e verifica come viene raccolto small_celery.py quando Celery non è disponibile. Esegui questo test in un ambiente senza Celery; il lavoro è completato quando il test viene ignorato correttamente invece di fallire durante la raccolta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Expected vs actual result
Expected
Tests should be skipped if Celery isn't installed.
Actual
Tests blow up with an ImportError similar to what's provided at the bottom of the report.
Reproducer
Attempt to run tests on host without Celery installed.
Versions
% python3 -V; uname -sr
Python 3.12.13
FreeBSD 15.1-RELEASE-p1
Version being tested/installed is vanilla 7.1.0.
Config
n/a
Code
% cd devel/py-pytest-cov
% sudo make test
...
<...>/freebsd-ports/devel/py-pytest-cov/work-py312/pytest_cov-7.1.0/tests/test_pytest_cov.py:771: Failed
------------------------------------------------------------------------------------------------------------ Captured stdout call -------------------------------------------------------------------------------------------------------------
running: /usr/local/bin/python3.12 -mpytest --basetemp=/tmp/pytest-of-root/pytest-0/test_celery0/runpytest-0 -vv -s --cov --cov-report=term-missing small_celery.py --basetemp=/tmp/pytest-of-root/pytest-0/basetemp
in: /tmp/pytest-of-root/pytest-0/test_celery0
============================= test session starts ==============================
platform freebsd15 -- Python 3.12.13, pytest-8.4.2, pluggy-1.6.0 -- /usr/local/bin/python3.12
cachedir: .pytest_cache
hypothesis profile 'default'
rootdir: /tmp/pytest-of-root/pytest-0/test_celery0
configfile: pyproject.toml
plugins: hypothesis-6.155.7, cov-7.1.0, xdist-3.8.0, flaky-3.8.1
collecting ... collected 0 items / 1 error
==================================== ERRORS ====================================
_______________________ ERROR collecting small_celery.py _______________________
ImportError while importing test module '/tmp/pytest-of-root/pytest-0/test_celery0/small_celery.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.12/site-packages/_pytest/python.py:498: in importtestmodule
mod = import_path(
/usr/local/lib/python3.12/site-packages/_pytest/pathlib.py:587: in import_path
importlib.import_module(module_name)
/usr/local/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
???
<frozen importlib._bootstrap>:1360: in _find_and_load
???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:935: in _load_unlocked
???
/usr/local/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
exec(co, module.__dict__)
small_celery.py:3: in <module>
from celery import Celery
E ModuleNotFoundError: No module named 'celery'
=========================== short test summary info ============================
ERROR small_celery.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.48s ===============================
- Lingua principale
- Python
- Stelle
- 2.1k
- Fork
- 256
- Merge medio
- 6g 10m
- PR unite (30g)
- 2
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
-
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 18 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 90 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 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
pytest-dev/pytest-cov#746 · 2 commenti ·
Tutte le issue di pytest-dev/pytest-cov
Issue simili
-
[BUG]: Compliance rules never see Unity Catalog views as viewsForse già presa @wagnercsantos l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
databrickslabs/ontos#1348 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ibm-granite/granite.build#649 ·
I maintainer di solito rispondono entro 1 giorno
-
`forum_pr_poster` action will always return `none` when checking for pre-existing feedback threads, even if a feedback thread already exists.Forse già presa @pgmzeta l’ha presa oggi. ApertaE-Verified P-Major
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
goonstation/goonstation#28259 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
woonstadrotterdam/monumenten#70 ·
I maintainer di solito rispondono entro 15 giorni
-
binding:python bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno