def test_exception(self, pdb): from jove.scripts.main import debug foo = mock.Mock() foo.side_effect = Exception('foo') wrapped = debug(foo) wrapped('foo') self.assertEqual(pdb.method_calls, [('post_mortem', (), {})])
def test_no_exception(self, pdb): from jove.scripts.main import debug foo = mock.Mock() wrapped = debug(foo) wrapped('foo') self.assertEqual(foo.call_count, 1) self.assertEqual(foo.call_args, (('foo',), {})) self.assertEqual(pdb.method_calls, [])