def context_with_data() -> CodeExecutorContext:
  """Fixture for a CodeExecutorContext with some pre-populated data."""
  state_data = {
      "_code_execution_context": {
          "execution_session_id": "session123",
          "processed_input_files": ["file1.csv", "file2.txt"],
      },
      "_code_executor_input_files": [
          {"name": "input1.txt", "content": "YQ==", "mime_type": "text/plain"}
      ],
      "_code_executor_error_counts": {"invocationA": 2},
  }
  state = State(state_data, {})
  return CodeExecutorContext(state)
Fixture for a CodeExecutorContext with some pre-populated data.
tests/unittests/code_executors/test_code_executor_context.py