Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`run` with a `name__mutmut_*` pattern runs the whole test suite in the clean-test check

Aperta Adatta ai principianti
#592 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
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
testing

Direzione di ricerca

Inizia leggendo tests_for_mutant_names e come il controllo clean-test passa il suo risultato a PytestRunner.run_tests. Riproduci il problema con il pattern mutmut run fornito e un test al di fuori della copertura della funzione che registri se è stato eseguito. Il lavoro è completato quando il controllo clean-test non esegue quel test non correlato e continua a selezionare i mutanti previsti.

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

Descrizione

mutmut 3.7.0. mutmut run "pkg.mod.x_f__mutmut_*" selects exactly f's mutants,
but before testing them the "Running clean tests" step calls
tests_for_mutant_names, which, for a pattern containing *, fnmatches it
against the keys of tests_by_mangled_function_name. Those keys are function
names (pkg.mod.x_f), which a pattern ending in __mutmut_* never matches, so
the test set is empty and PytestRunner.run_tests(tests=set()) falls back to
the whole suite, single process.

Effect on a 19k-test suite: 607s of a 640s run (122 mutants; the mutants
themselves took 16s).

Repro: any project; mutmut run "<module>.x_<func>__mutmut_*" with a test
outside that function's coverage that records it ran: it runs during
"Running clean tests".

Suggested fix: in tests_for_mutant_names, for a pattern containing *,
also match mangled_name_from_mutant_name-style (strip __mutmut_ and what
follows) against the function keys, or match each function key k by
fnmatch(k + "__mutmut_1", pattern).

Lingua principale
Python
Stelle
1.5k
Fork
179
Merge medio
1g 18h
PR unite (30g)
6

Preparare l'ambiente

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 boxed/mutmut

Tutte le issue di boxed/mutmut

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.