pytest設置logging級別的輸出


寫腳本過程中發現,需要設置pytest的日志輸出級別,在pytest-html測試報告上才會顯示鋪捉到並顯示相應的日志內容,具體方法如下

 

 

 

 

 參考地址:https://docs.pytest.org/en/stable/logging.html

 
        

 

 

 

 

pytest --log-format="%(asctime)s %(levelname)s %(message)s" \ --log-date-format="%Y-%m-%d %H:%M:%S"

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM