def test_increment_error_count_existing_invocation(
    context_with_data: CodeExecutorContext,
):
  """Test incrementing error count for an existing invocation ID."""
  context_with_data.increment_error_count("invocationA")
  assert (
      context_with_data._session_state["_code_executor_error_counts"][
          "invocationA"
      ]
      == 3
  )
Test incrementing error count for an existing invocation ID.
tests/unittests/code_executors/test_code_executor_context.py