Éric Araujo <mer...@netwok.org> 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 <rep...@bugs.python.org> <http://bugs.python.org/issue11287> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com