mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-07-07 14:45:00 +00:00
Remove implementation-specific test
The test was checking source code for specific strings rather than testing behavior. The existing subprocess tests already verify the functionality works correctly.
This commit is contained in:
parent
9ef9da9ab6
commit
67193350e2
1 changed files with 0 additions and 25 deletions
|
@ -1,25 +0,0 @@
|
|||
"""Test FastAPI streaming compatibility (issue #4 fix)."""
|
||||
|
||||
import inspect
|
||||
|
||||
from claude_code_sdk._internal.transport.subprocess_cli import SubprocessCLITransport
|
||||
|
||||
|
||||
def test_no_task_groups_in_receive_messages():
|
||||
"""Verify receive_messages doesn't use task groups (fixes FastAPI issue #4)."""
|
||||
# Get the source code of receive_messages
|
||||
source = inspect.getsource(SubprocessCLITransport.receive_messages)
|
||||
|
||||
# The fix: ensure no task group or task creation
|
||||
assert "create_task_group" not in source, (
|
||||
"receive_messages must not use create_task_group to avoid "
|
||||
"RuntimeError with FastAPI streaming"
|
||||
)
|
||||
assert "asyncio.create_task" not in source, (
|
||||
"receive_messages must not create tasks to maintain "
|
||||
"compatibility with FastAPI's generator handling"
|
||||
)
|
||||
|
||||
# Verify stderr is still being read (sequential approach)
|
||||
assert "_stderr_stream" in source, "Should still read stderr"
|
||||
assert "stderr_lines" in source, "Should collect stderr output"
|
Loading…
Add table
Add a link
Reference in a new issue