Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Celery tests require package; test blows up if Celery not installed instead of skipping the tests gracefully

オープン 初心者向け
#750 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@dchaudhari7177 がすでに取り組んでいます。

2026年7月26日 から。

  • #752 @dchaudhari7177 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
testing-qa

調査の方向性

tests/test_pytest_cov.py の test_celery 付近から始め、Celery が利用できない場合に small_celery.py がどのように収集されるかを確認します。Celery のない環境でそのテストを実行し、収集中に失敗するのではなく、テストが適切にスキップされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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 ===============================
主要言語
Python
スター
2.1k
フォーク
253
平均マージ
12日 4時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pytest-dev/pytest-cov のほかの issue

pytest-dev/pytest-cov の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。