mverleg / pyjson_tricks

Extra features for Python's JSON: comments, order, numpy, pandas, datetimes, and many more! Simple but customizable.
Other
154 stars 23 forks source link

Do not use warns(None) to check for no warnings #102

Closed s-t-e-v-e-n-k closed 3 months ago

s-t-e-v-e-n-k commented 3 months ago

warns(None) is an anti-pattern, and is explicitly forbidden starting from pytest 8.0. Instead, we catch all warnings, and filter them to be errors, so they will raise an (uncaught) exception. Drive-by importing warns from pytest rather than the internal name.