Skip to content

Commit f1a88c0

Browse files
committed
fix: skip get_type_hints test on Python 3.9
PEP 604 union syntax (str | Path) in from_yaml's signature causes get_type_hints() to fail on Python 3.9. Skip this annotation-only test on < 3.10. Made-with: Cursor
1 parent 08a58cc commit f1a88c0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_builder_validation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Tests for the builder-validator integration."""
22

3+
import sys
4+
35
import pytest
46

57
from latence._pipeline.builder import PipelineBuilder
@@ -70,12 +72,12 @@ def test_alias_resolution_in_add():
7072
# =============================================================================
7173

7274

75+
@pytest.mark.skipif(sys.version_info < (3, 10), reason="PEP 604 unions in get_type_hints")
7376
def test_from_yaml_returns_builder():
7477
"""Verify PipelineBuilder.from_yaml has the right return type annotation."""
7578
from typing import get_type_hints
7679

7780
hints = get_type_hints(PipelineBuilder.from_yaml)
78-
# Return can be PipelineBuilder or forward reference string
7981
return_hint = hints.get("return")
8082
assert return_hint is PipelineBuilder or (
8183
isinstance(return_hint, str) and "PipelineBuilder" in return_hint

0 commit comments

Comments
 (0)