Disable log suppression in Python tests?

Aperta Adatta ai principianti
#4,330 1 commento 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
68/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
testing

Direzione di ricerca

Leggi python/ctsm/unit_testing.py intorno a setup_for_tests() e controlla i suoi chiamanti nei test Python, in run_ctsm_py_tests.py e nel Makefile. Confronta i log acquisiti e i test dei messaggi di log quando vengono eseguiti tramite questi wrapper e direttamente con pytest. Il lavoro è completo quando i test non riusciti mostrano i propri log e i test dei messaggi di log si comportano in modo coerente in tutti questi punti di ingresso.

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

Descrizione

b4b code health next

The setup_for_tests() function in python/ctsm/unit_testing.py is called in various Python system and unit tests, as well as by run_ctsm_py_tests.py. As you can see, it suppresses log messages:
https://github.com/ESCOMP/CTSM/blob/5e1da3a64f758991cf0c0b52f30cf5e3646099bf/python/ctsm/unit_testing.py#L21-L30

I think this should be eliminated now that we've moved from unittest to pytest, which by default suppresses all logs for tests that pass. Two reasons:

  1. If a test fails, we want to see its logs.
  2. Without special handling, tests that check log messages would behave differently when run with one of our wrappers (Makefile or run_ctsm_py_tests.py) as opposed to with pytest directly.
Lingua principale
Fortran
Stelle
362
Fork
372
Merge medio
1g 11h
PR unite (30g)
9

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 ESCOMP/CTSM

Tutte le issue di ESCOMP/CTSM

Issue simili

Altre issue su Testing & QA

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.