[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-07 Thread Florent Xicluna
Florent Xicluna added the comment: Fixed (with tests) in r78094. Thank you Michael. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-07 Thread Michael Foord
Changes by Michael Foord : -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-07 Thread Florent Xicluna
Florent Xicluna added the comment: Thank you for this answer. The "exception" argument could be useful. But it does not work as documented on r77999... Btw, the documentation explains the behaviour I expect... -- status: closed -> pending ___ Python

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-07 Thread Michael Foord
Michael Foord added the comment: Just use the context manager and the exception is available as exc_value. -- nosy: +michael.foord resolution: -> rejected stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: 2010/2/7 Georg Brandl : > > Georg Brandl added the comment: > > Why not the un-magic context manager, which has an exc_value attribute with > the exception? That's what I meant, but our perceptions of magic are clearly different. :) -- __

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-07 Thread Georg Brandl
Georg Brandl added the comment: Why not the un-magic context manager, which has an exc_value attribute with the exception? -- nosy: +georg.brandl ___ Python tracker ___

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-05 Thread Benjamin Peterson
Benjamin Peterson added the comment: I'd prefer for the magic context manager to be returned. -- nosy: +benjamin.peterson ___ Python tracker ___ _

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Too clever by far. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Indeed. In that case, I am all for it. -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-05 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-05 Thread Florent Xicluna
Florent Xicluna added the comment: right, but it could return a wrapper object which receives the exception on __exit__. -- ___ Python tracker ___ __

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: You can't get the exception before it is even raised... -- nosy: +pitrou ___ Python tracker ___ ___

[issue7859] support "with self.assertRaises(SomeException) as exc:" syntax

2010-02-05 Thread Florent Xicluna
New submission from Florent Xicluna : It would be useful to get the actual exception in order to introspect its attributes. (See some potential uses in "test_dict") -- components: Tests messages: 98882 nosy: flox priority: normal severity: normal status: open title: support "with self.