[Other] tools/test_strata_mcp.py: unittest.main() sits before the last three test classes, so a direct run skips 7 tests

Aperta Adatta ai principianti
#4,906 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@XiaoBinGan ci sta già lavorando.

Dal 1/11/2026.

  • #4907 di @XiaoBinGan — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
testing

Direzione di ricerca

Apri tools/test_strata_mcp.py e trova il blocco if __name__ == "__main__": con unittest.main() vicino alla riga 937, che si trova prima delle classi RemoveMissingFilesTest, DiskUsageTest e DraftLayerAndCancel. Sposta questa guardia alla fine del file, in modo che tutte le classi siano definite prima che venga eseguita. Il lavoro è completato quando python tools/test_strata_mcp.py riporta 52 test, in linea con python -m unittest tools.test_strata_mcp. L'unico errore emerso dal controllo DeepSeek su Mac appartiene a #4904 ed è al di fuori di questa correzione.

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

Descrizione

tools/test_strata_mcp.py ends its run early when it is executed directly: its if __name__ == "__main__": unittest.main() block sits at line 937 of 1112, before the last three test classes. unittest.main() collects the
classes defined at that point, so the classes appended after it never run.

Reproduce

$ python tools/test_strata_mcp.py
Ran 45 tests in 68.455s
FAILED (failures=1)                      # the Mac DeepSeek check, a separate issue (#4904)

$ python -m unittest tools.test_strata_mcp
Ran 52 tests in ...                      # the same 45 plus the 7 below

The 7 tests in RemoveMissingFilesTest, DiskUsageTest and DraftLayerAndCancel are skipped by the direct run,
silently, with no warning. They are in the file's own sections ("Deleting a model whose plan lists files that are
already gone…", "Storage showed IQ3_S as 0.0 GB…", draft-layer progress), so a person running the file the way the
other tools/test_*.py files are run does not see them pass or fail.

The classes came in later commits (917d2fc3, 31030b17) appended at the end of the file, after the guard that
was already in the middle.

Expected

Every test in the file runs in a direct run as well, like the other tools/test_strata_mcp.py classes.

Lingua principale
C++
Stelle
11.6k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 Niko1221/Strata

Tutte le issue di Niko1221/Strata

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.