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

Aperta Adatta ai principianti
#255 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Il pattern dei file si trova in PYTHON_TEST_FILES in ecosystems/python/init.py, intorno alle righe 289-292; leggi prima la regex e l'utilizzo di TestFiles. Estendilo in modo che vengano riconosciuti i file *_tests.py e i file sotto una directory tests/, usando il repro pkg/tests/build_tests.py che contiene unittest.TestCase. È fatto quando quel file viene rilevato e i casi esistenti test_*.py e *_test.py continuano a corrispondere.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
4
Fork
1
Merge medio
10h 41m
PR unite (30g)
79

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cpp-best-practices/project_validator

Tutte le issue di cpp-best-practices/project_validator

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.