Introduce "with py.test.raises(...)"

Create issue
Issue #103 resolved
Holger Krekel repo owner created an issue

For those who want to keep their code compatible to >=Python2.6 it'd be nice to extend py.test.raises with a third form:

{{{ with py.test.raises(ValueError): #codeblock }}}

which would be equivalent to using the previous string-notation: {{{ py.test.raises(ValueError, "#codeblock") }}}

I believe this could be implemented in a manner that preserves py.test's single-source nature for Python2.4-Python3.1.

And i wonder if there are other potential extensions/uses for newer syntax.

Comments (2)

  1. Log in to comment