Closed nphilipp closed 4 months ago
New versions of pytest don’t catch log.warning() as a UserWarning. Use the caplog fixture instead.
Related: #2727 Fixes: #2748
Use the caplog fixture instead of pytest.warns() to check for warnings emitted with log.warning(), as outlined in https://github.com/RDFLib/rdflib/pull/2727#issuecomment-1994503300
caplog
pytest.warns()
log.warning()
coverage: 91.039% (+0.009%) from 91.03% when pulling 03bb7c11d61db79ec6b5f1245733da26c9867355 on nphilipp:main--pytest8-compat into 0ecc40009ae397c2798c0c08a2d751a1a9d2f8a7 on RDFLib:main.
Thanks @nphilipp!
New versions of pytest don’t catch log.warning() as a UserWarning. Use the caplog fixture instead.
Related: #2727 Fixes: #2748
Summary of changes
Use the
caplog
fixture instead ofpytest.warns()
to check for warnings emitted withlog.warning()
, as outlined in https://github.com/RDFLib/rdflib/pull/2727#issuecomment-1994503300Checklist