"""Pytest configuration and shared fixtures."""

from __future__ import annotations

import pytest

from kytchen.repl.sandbox import REPLEnvironment, SandboxConfig


@pytest.fixture
def sandbox_config() -> SandboxConfig:
    """Default sandbox configuration for tests."""
    return SandboxConfig(timeout_seconds=5.0)


@pytest.fixture
def repl(sandbox_config: SandboxConfig) -> REPLEnvironment:
    """REPL environment with test context."""
    return REPLEnvironment(
        context="test context for unit tests",
        context_var_name="ctx",
        config=sandbox_config,
    )


@pytest.fixture
def repl_multiline(sandbox_config: SandboxConfig) -> REPLEnvironment:
    """REPL environment with multiline context."""
    context = "line0\nline1\nline2\nline3\nline4\nline5"
    return REPLEnvironment(
        context=context,
        context_var_name="ctx",
        config=sandbox_config,
    )
