diff --git a/python/packages/foundry_hosting/agent_framework_foundry_hosting/_ids.py b/python/packages/foundry_hosting/agent_framework_foundry_hosting/_ids.py index 588231d07..f4e6b3d4f 100644 --- a/python/packages/foundry_hosting/agent_framework_foundry_hosting/_ids.py +++ b/python/packages/foundry_hosting/agent_framework_foundry_hosting/_ids.py @@ -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 diff --git a/python/packages/hosting/tests/conftest.py b/python/packages/hosting/tests/conftest.py new file mode 100644 index 000000000..aa6775671 --- /dev/null +++ b/python/packages/hosting/tests/conftest.py @@ -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)