Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Tests fail if not 'codespell' installed

Đang mở
#3,433 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
testing

Hướng nghiên cứu

Start with codespell_lib/tests/test_basic.py, especially the run_codespell and run_codespell_stdin helpers and the failing test_command and test_stdin cases. Reproduce the reported wheel-build and pytest workflow without codespell on PATH; done means those tests pass in that setup.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

It looks like the project tests use codespell from $PATH rather than from the source tree.

I am following Arch linux build instructions. I build the project with python -m build --wheel --no-isolation then run tests with pytest and it fails:

$ pytest
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.12.3, pytest-8.2.1, pluggy-1.5.0
rootdir: /storage/sources/codespell
configfile: pyproject.toml
testpaths: codespell_lib/tests
plugins: dependency-0.6.0, cov-4.1.0, typeguard-4.2.1
collected 113 items                                                                                                                                                                                               

codespell_lib/tests/test_basic.py .F........................................................F                                                                                                               [ 52%]
codespell_lib/tests/test_dictionary.py ..............................ssssssssssssssss........                                                                                                               [100%]

==================================================================================================== FAILURES =====================================================================================================
__________________________________________________________________________________________________ test_command ___________________________________________________________________________________________________
codespell_lib/tests/test_basic.py:85: in test_command
    assert run_codespell(cwd=tmp_path) == 0
codespell_lib/tests/test_basic.py:72: in run_codespell
    proc = subprocess.run(
/usr/lib/python3.12/subprocess.py:548: in run
    with Popen(*popenargs, **kwargs) as process:
/usr/lib/python3.12/subprocess.py:1026: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
/usr/lib/python3.12/subprocess.py:1955: in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
E   FileNotFoundError: [Errno 2] No such file or directory: 'codespell'
___________________________________________________________________________________________________ test_stdin ____________________________________________________________________________________________________
codespell_lib/tests/test_basic.py:1367: in test_stdin
    assert run_codespell_stdin(
codespell_lib/tests/test_basic.py:1342: in run_codespell_stdin
    proc = subprocess.run(
/usr/lib/python3.12/subprocess.py:548: in run
    with Popen(*popenargs, **kwargs) as process:
/usr/lib/python3.12/subprocess.py:1026: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
/usr/lib/python3.12/subprocess.py:1955: in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
E   FileNotFoundError: [Errno 2] No such file or directory: 'codespell'
------------------------------------------------------------------------ generated xml file: /storage/sources/codespell/junit-results.xml -------------------------------------------------------------------------
============================================================================================= short test summary info =============================================================================================
SKIPPED [16] codespell_lib/tests/test_dictionary.py:223: requires aspell-en
==================================================================================== 2 failed, 95 passed, 16 skipped in 56.63s ====================================================================================
Ngôn ngữ chính
Python
Star
2.4k
Fork
531
Merge trung bình
15 giờ 5 phút
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codespell-project/codespell

Tất cả issue của codespell-project/codespell

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.