Skip to content

Commit bcce08c

Browse files
committed
fix test
1 parent edbb878 commit bcce08c

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tests/test_decorators.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,13 +1878,13 @@ async def parent_function():
18781878

18791879

18801880
@pytest.mark.asyncio
1881-
async def test_async_generator_exception_handling_with_context():
1882-
"""Test that exceptions in async generators are properly handled while preserving context"""
1881+
async def test_sync_generator_exception_handling_with_context():
1882+
"""Test that exceptions in sync generators are properly handled while preserving context"""
18831883
langfuse = get_client()
18841884
mock_trace_id = langfuse.create_trace_id()
18851885

18861886
@observe(name="failing_generator")
1887-
async def failing_generator():
1887+
def failing_generator():
18881888
current_span = trace.get_current_span()
18891889
# Verify we have valid context even when exception occurs
18901890
assert (
@@ -1893,7 +1893,6 @@ async def failing_generator():
18931893
)
18941894

18951895
yield "first_item"
1896-
await asyncio.sleep(0.001)
18971896
raise ValueError("Generator failure test")
18981897
yield "never_reached" # This should never execute
18991898

@@ -1906,7 +1905,7 @@ async def root_function():
19061905

19071906
items = []
19081907
with pytest.raises(ValueError, match="Generator failure test"):
1909-
async for item in generator:
1908+
for item in generator:
19101909
items.append(item)
19111910

19121911
langfuse.flush()

0 commit comments

Comments
 (0)