CursorMock needs to behave like a contextmanager.