[issue11759] assert for exception parameters

2011-04-04 Thread anatoly techtonik
anatoly techtonik added the comment: Thanks for clarification, Ezio. I am still using Python 2.7 - that's why I've missed this part. -- ___ Python tracker ___ _

[issue11759] assert for exception parameters

2011-04-04 Thread Ezio Melotti
Ezio Melotti added the comment: That was a design decision made by Guido (iirc), and even if it might seem not obvious at first, it's probably just because not everyone is Dutch. Many people would probably vote on sequence.join(sep) too, but it's unlikely that another way to do it will be intr

[issue11759] assert for exception parameters

2011-04-04 Thread anatoly techtonik
anatoly techtonik added the comment: I've also found #9587. Now I wonder how many people requested return vs context, and how many would vote for one vs another. Nothing personal - just a pure curiosity. -- ___ Python tracker

[issue11759] assert for exception parameters

2011-04-04 Thread Ezio Melotti
Ezio Melotti added the comment: See also #6275. -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue11759] assert for exception parameters

2011-04-04 Thread R. David Murray
R. David Murray added the comment: Using assertRaises as a context manager is not a hack, and is the correct way to do this in unittest. -- nosy: +r.david.murray status: open -> closed ___ Python tracker

[issue11759] assert for exception parameters

2011-04-04 Thread anatoly techtonik
anatoly techtonik added the comment: I found that successful assert in twisted returns exception object. But thanks for workaround anyway. -- ___ Python tracker ___ ___

[issue11759] assert for exception parameters

2011-04-04 Thread anatoly techtonik
anatoly techtonik added the comment: Looks like a hack (and not the obvious one). I guess no asserts return values like this, so that usage is not really intuitive for me. -- ___ Python tracker __

[issue11759] assert for exception parameters

2011-04-04 Thread Michael Foord
Changes by Michael Foord : -- resolution: -> invalid stage: -> committed/rejected ___ Python tracker ___ ___ Python-bugs-list mailin

[issue11759] assert for exception parameters

2011-04-04 Thread Daniel Urban
Daniel Urban added the comment: What about this: >>> class MyTestCase(TestCase): ... def test_foo(self): ... with self.assertRaises(SyntaxError) as cm: ... compile('asdf jkl', 'file.py', 'eval') ... self.assertEqual('file.py', cm.exception.filenam

[issue11759] assert for exception parameters

2011-04-03 Thread anatoly techtonik
New submission from anatoly techtonik : I've just realized that unittest doesn't provide a way to test arguments of exception thrown during assertRaises check. -- components: Tests messages: 132919 nosy: techtonik priority: normal severity: normal status: open title: assert for exceptio