Éric Araujo <[email protected]> added the comment:
+ try:
+ with f: pass
+ except Exception as e:
+ self.assertIsInstance(e, ValueError)
+ else:
+ self.assertFailed()
I find this form easier to read:
with self.assertRaises(ValueError):
with f:
pass
----------
nosy: +eric.araujo
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11287>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com