Python tests: `*_tests.py` (mkdocs/tests/*_tests.py, discovered with `unittest discover -p "*tests.py"`) is not a test file pattern

Đang mở Phù hợp với người mới
#255 0 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
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
tooling

Hướng nghiên cứu

Mẫu tệp nằm trong PYTHON_TEST_FILES ở ecosystems/python/init.py, quanh dòng 289-292; hãy đọc regex và cách dùng TestFiles trước. Mở rộng nó để nhận diện các tệp *_tests.py và các tệp nằm trong thư mục tests/, dùng ví dụ tái hiện pkg/tests/build_tests.py chứa unittest.TestCase. Hoàn thành khi tệp đó được phát hiện và các trường hợp test_*.py và *_test.py hiện có vẫn khớp.

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

Mô tả

mkdocs: FAIL "no tests found (test_*.py or *_test.py files)" for 12 mkdocs/tests/*_tests.py files in a tests/ directory. When unittest discover -p names a pattern, use it; *_tests.py under tests/ is common anyway.

Evidence from the corpus audit

mkdocs/mkdocs / tests-run (test file pattern)
  • kind: FALSE_NEGATIVE
  • actual: FAIL "Python: no tests found (test_*.py or *_test.py files)".
  • expected: tests found: mkdocs/tests/*_tests.py (12 files in a tests/ directory), discovered by CI with
    unittest discover -p "*tests.py".
  • evidence: ls mkdocs/tests → build_tests.py, cli_tests.py, config/, gh_deploy_tests.py, ...;
    pyproject.toml:122: test = 'python -m unittest discover -s mkdocs -p "*tests.py"'. Validator:
    ecosystems/python/__init__.py:289-292: PYTHON_TEST_FILES = TestFiles(... path=re.compile(r"(?:^|/)(?:test_[^/]*| [^/]*_test)\.py$")) — _tests.py (plural) and files under a tests/ directory do not match.
  • repro: pkg/tests/build_tests.py containing unittest.TestCase.
  • confidence: medium (unusual naming, but the tests/ directory is unambiguous and the discover pattern is readable)

Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

Ngôn ngữ chính
Python
Star
4
Fork
1
Merge trung bình
10 giờ 41 phút
Pull request đã merge (30 ngày)
79

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 cpp-best-practices/project_validator

Tất cả issue của cpp-best-practices/project_validator

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.