Pyteryx/alteryx_runner/tests/conftest.py

26 lines
549 B
Python

"""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()