"""Shared fixtures for tests."""
from __future__ import annotations
import sys
from pathlib import Path
import pytest
import duckdb

# Ensure the alteryx_runner package root is on sys.path
PKG = Path(__file__).parent.parent  # alteryx_runner/
if str(PKG) not in sys.path:
    sys.path.insert(0, str(PKG))

from engine.context import RunContext


@pytest.fixture
def ctx(tmp_path):
    return RunContext(workflow_dir=str(tmp_path), verbose=False)


@pytest.fixture
def duckdb_con():
    con = duckdb.connect(":memory:")
    yield con
    con.close()
