import sys
from pathlib import Path

import pytest

# Ensure test apps are importable
sys.path.insert(0, str(Path(__file__).parent / "apps"))


@pytest.fixture
def simple_app():
    from simple_app import SimpleApp
    return SimpleApp()


@pytest.fixture
def error_app():
    from error_app import ErrorApp
    return ErrorApp()


@pytest.fixture
def worker_app():
    from worker_app import WorkerApp
    return WorkerApp()


@pytest.fixture
def input_app():
    from input_app import InputApp
    return InputApp()


@pytest.fixture
def calculator_app():
    sys.path.insert(0, str(Path(__file__).parent.parent.parent / "textual" / "examples"))
    from calculator import CalculatorApp
    return CalculatorApp()
