Azure / pytest-azurepipelines

Plugin for pytest that makes it simple to work with Azure Pipelines
MIT License
112 stars 35 forks source link

Make warning logs optional with this plugin, please! #86

Open gilaser opened 1 year ago

gilaser commented 1 year ago

We need to use this plugin to successfully run & publish code coverage for our build pipeline. Unfortunately, adding this plugin also produces ##vso-style warning logs that then show up on our Build Summary page and pollute our UI. To be clear, our pipeline logs already show the warnings, but this pipeline reiterates the warnings with ##vso logs, which is unnecessary and distracting. We are requesting that an option be added to turn off these logs. Thanks for your help & consideration!

ursu123 commented 8 months ago

I fixed this by adding a pytest.ini file in my /tests folder with the following content:

[pytest]
filterwarnings =
    ignore::pytest.PytestCacheWarning
    ignore::DeprecationWarning

The ignore::pytest.PytestCacheWarning is related to warnings that I was receiving when running locally, but ignore::DeprecationWarning worked to remove the deprecation warnings from my pipeline.