--- you can reply above this line ---

New issue 103: Introduce "with py.test.raises(...)"
http://bitbucket.org/hpk42/py-trunk/issue/103/introduce-with-pytestraises

holger krekel / hpk42 on Sat, 29 May 2010 15:47:47 +0200:

Description:
  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) as excinfo:
      #codeblock
}}}

which would be equivalent to using the previous string-notation:
{{{
excinfo = 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. 


Responsible:
  hpk42
-- 
This is an issue notification from bitbucket.org.
You are receiving this either because you are the
owner of the issue, or you are following the issue.
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to