'Batch callbacks should NOT fire if batch is not executed in context manager mode'

def test_callbacks_tied_to_execute(self):

    call_history = []
    def my_callback(*args, **kwargs):
        call_history.append(args)
    with BatchQuery() as batch:
        batch.add_callback(my_callback)
    self.assertEqual(len(call_history), 1)
    class SomeError(Exception, ):
        pass
    with self.assertRaises(SomeError):
        with BatchQuery() as batch:
            batch.add_callback(my_callback)
            raise SomeError
    self.assertEqual(len(call_history), 1)
    with self.assertRaises(SomeError):
        with BatchQuery(execute_on_exception=True) as batch:
            batch.add_callback(my_callback)
            raise SomeError
    self.assertEqual(len(call_history), 2)
