""" This file contains shared pytest fixtures for all test files. Fixtures defined here are automatically available to all test files. """ import pytest import os import sys from flask import Flask # Add the parent directory to sys.path to allow importing from the backend package sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) # Import the Flask app for testing from backend.app import app @pytest.fixture def client(): """Create a test client for the Flask app.""" app.config['TESTING'] = True with app.test_client() as client: yield client @pytest.fixture def app_context(): """Create an application context for the Flask app.""" with app.app_context(): yield