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

后端 未结 3 1298
-上瘾入骨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:35

    This is now built into pytest. Just add '--log-level=' to the command line when running your test. For example:

    pytest --log-level=INFO
    

    Documentation updates can be found here: https://docs.pytest.org/en/latest/logging.html

提交回复
热议问题