Right now one of my code-bases is filled with assertions like:

with raises(SpecificError) as error:
    some_action()
assert 'specific message' == str(error)

Why not change `raises` to allow instances of exceptions as well:

with raises(SpecificError('specific message')):
    some_action()

I think, this can improve readability of `raises` assertions. Can't even think 
of immediate downsides of this.

What do you think?

—Vladimir
_______________________________________________
Pytest-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to