pytest - specify log level from the CLI command running the tests

后端 未结 3 1303
-上瘾入骨i
-上瘾入骨i 2021-02-05 18:06

my team and I are using Pytest + Jenkins to automate our product testing. we have been using the standard Logging lib of python to get proper log messages during testing, before

3条回答
  •  星月不相逢
    2021-02-05 18:16

    Try --log-cli-level=INFO

    like:

    pytest -vv -s --log-cli-level=INFO --log-cli-format="%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)" --log-cli-date-format="%Y-%m-%d %H:%M:%S" ./test_file.py
    

提交回复
热议问题