Fix remaining Python hosting checks

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
eavanvalkenburg
2026-06-17 18:41:10 +02:00
parent eb2e0adc60
commit 3cdc751a70
2 changed files with 27 additions and 2 deletions
@@ -45,7 +45,7 @@ def foundry_response_id(previous_response_id: str | None = None) -> str:
return IdGenerator.new_response_id(previous_response_id or "")
def foundry_response_id_factory() -> "Any":
def foundry_response_id_factory() -> Any:
"""Return a callable suitable for ``ResponsesChannel(response_id_factory=...)``.
The returned callable accepts an optional ``previous_response_id``
@@ -55,7 +55,7 @@ def foundry_response_id_factory() -> "Any":
return foundry_response_id
def foundry_item_id(item: "Any", response_id: str | None = None) -> str | None:
def foundry_item_id(item: Any, response_id: str | None = None) -> str | None:
"""Mint a Foundry-storage-compatible item id for *item*.
Dispatches via :meth:`IdGenerator.new_item_id` so the id picks up
+25
View File
@@ -0,0 +1,25 @@
# Copyright (c) Microsoft. All rights reserved.
"""Pytest configuration for hosting tests."""
from __future__ import annotations
import importlib.util
import sys
from pathlib import Path
def pytest_configure() -> None:
"""Make local workflow fixtures importable in package and aggregate test modes."""
module_name = "tests._workflow_fixtures"
if module_name in sys.modules:
return
fixture_path = Path(__file__).with_name("_workflow_fixtures.py")
spec = importlib.util.spec_from_file_location(module_name, fixture_path)
if spec is None or spec.loader is None:
raise ImportError(f"Unable to load workflow fixtures from {fixture_path}")
module = importlib.util.module_from_spec(spec)
sys.modules[module_name] = module
spec.loader.exec_module(module)