def METHOD_NAME(self):
    """Test session as a context manager."""
    with Session(service=MagicMock(), backend="ibm_gotham") as session:
        session.run(program_id="foo", inputs={})
        session.close()
    self.assertFalse(session._active)