python2.6:
with self.assertRaises(SystemExit, func) as cm:
your_method()
self.assertEqual(cm.exception.error_code, 1)
>python 2.7:
with self.assertRaisesRegexp(SystemExit, '1'):
your_method()
python2.6:
with self.assertRaises(SystemExit, func) as cm:
your_method()
self.assertEqual(cm.exception.error_code, 1)
>python 2.7:
with self.assertRaisesRegexp(SystemExit, '1'):
your_method()