qntm / greenery

Regular expression manipulation library
http://qntm.org/greenery
MIT License
311 stars 40 forks source link

test/style: use `pytest.raises` vs `except: …`/`assert False` #70

Closed rwe closed 1 year ago

rwe commented 1 year ago

Clearer than the previous pattern of catching AssertionError and then re-asserting False, and provides better stack traces.

This also improves a few of those tests to match on specific exception messages, since the exceptions are not currently typed in most cases.