RDFLib / rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
https://rdflib.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.18k stars 558 forks source link

Fix testing for warnings with pytest 8 (#2748) #2817

Closed nphilipp closed 4 months ago

nphilipp commented 4 months ago

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 of pytest.warns() to check for warnings emitted with log.warning(), as outlined in https://github.com/RDFLib/rdflib/pull/2727#issuecomment-1994503300

Checklist

coveralls commented 4 months ago

Coverage Status

coverage: 91.039% (+0.009%) from 91.03% when pulling 03bb7c11d61db79ec6b5f1245733da26c9867355 on nphilipp:main--pytest8-compat into 0ecc40009ae397c2798c0c08a2d751a1a9d2f8a7 on RDFLib:main.

nicholascar commented 4 months ago

Thanks @nphilipp!