Skip to content

Commit 1cc8d63

Browse files
committed
test
1 parent dfde50d commit 1cc8d63

File tree

4 files changed

+0
-84
lines changed

4 files changed

+0
-84
lines changed

tests/trace/test_anonymous_ops.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,6 @@
22
from weave.trace_server.trace_server_interface import CallsQueryReq
33

44

5-
def test_named_op(client: weave_client.WeaveClient) -> str:
6-
call = client.create_call("anonymous_op", {"a": 1})
7-
client.finish_call(call, {"c": 3}, None)
8-
9-
call_res = client.server.calls_query(
10-
CallsQueryReq(
11-
project_id=client._project_id(),
12-
)
13-
)
14-
calls = call_res.calls
15-
16-
assert len(calls) == 1
17-
call = calls[0]
18-
assert (
19-
call.op_name
20-
== "weave:///shawn/test-project/op/anonymous_op:IMZjfLeSAoLTYu8QLPrVVXrNIFX6jZlxAYAeRDEEezE"
21-
)
22-
assert call.inputs == {"a": 1}
23-
assert call.output == {"c": 3}
24-
assert call.exception is None
25-
26-
275
def test_anonymous_op(client: weave_client.WeaveClient) -> str:
286
call = client.create_call("anonymous_op", {"a": 1})
297
client.finish_call(call, {"c": 3}, None)

tests/trace/test_op_argument_forms.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -450,23 +450,6 @@ def my_op() -> int:
450450
assert res.calls[0].inputs == {}
451451

452452

453-
def test_args_empty(client):
454-
@weave.op
455-
def my_op() -> int:
456-
return 1
457-
458-
my_op()
459-
460-
res = client.server.calls_query(
461-
tsi.CallsQueryReq(
462-
project_id=client._project_id(),
463-
)
464-
)
465-
466-
assert res.calls[0].op_name == my_op.ref.uri()
467-
assert res.calls[0].inputs == {}
468-
469-
470453
def test_args_concrete(client):
471454
@weave.op
472455
def my_op(val):

tests/trace/test_op_generators.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -203,44 +203,6 @@ async def test_async_generator_with_custom_accumulator(client):
203203
assert calls[0].output == [0, 1, 2]
204204

205205

206-
@weave.op(accumulator=list_accumulator)
207-
def gen_with_decorator_accumulator(x: int) -> Generator[int, None, None]:
208-
yield from range(x)
209-
210-
211-
def test_generator_with_decorator_accumulator(client):
212-
# Call the generator with the accumulator from the decorator
213-
res = gen_with_decorator_accumulator(3)
214-
215-
# The generator still works as expected
216-
assert list(res) == [0, 1, 2]
217-
218-
# Get the call and check its output
219-
calls = client.get_calls()
220-
assert len(calls) == 1
221-
assert calls[0].output == [0, 1, 2]
222-
223-
224-
@weave.op(accumulator=async_list_accumulator)
225-
async def async_gen_with_decorator_accumulator(x: int) -> AsyncGenerator[int, None]:
226-
for i in range(x):
227-
yield i
228-
229-
230-
@pytest.mark.asyncio
231-
async def test_async_generator_with_decorator_accumulator(client):
232-
# Call the generator with the accumulator from the decorator
233-
res = async_gen_with_decorator_accumulator(3)
234-
235-
# The generator still works as expected
236-
assert [item async for item in res] == [0, 1, 2]
237-
238-
# Get the call and check its output
239-
calls = client.get_calls()
240-
assert len(calls) == 1
241-
assert calls[0].output == [0, 1, 2]
242-
243-
244206
def test_nested_generator_multiple_iterations(client):
245207
"""Test that nested generators work correctly when called multiple times.
246208

tests/trace_server_bindings/test_http_behavior_remote.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import httpx
1616
import pytest
1717
import tenacity
18-
from pydantic import ValidationError
1918

2019
from tests.trace_server_bindings.conftest import (
2120
generate_end,
@@ -88,12 +87,6 @@ def test_400_no_retry(mock_post, unbatched_server):
8887
unbatched_server.call_start(tsi.CallStartReq(start=start))
8988

9089

91-
def test_invalid_no_retry(unbatched_server):
92-
"""Test that validation errors are not retried."""
93-
with pytest.raises(ValidationError):
94-
unbatched_server.call_start(tsi.CallStartReq(start={"invalid": "broken"}))
95-
96-
9790
@patch("weave.utils.http_requests.post")
9891
def test_calls_complete_batch_endpoint_and_payload(mock_post, monkeypatch):
9992
"""Send calls_complete batches to the v2 endpoint with correct payload."""

0 commit comments

Comments
 (0)