Skip to content

Commit c31f93d

Browse files
chore: suppress third-party deprecation warnings (#38)
1 parent 41e89be commit c31f93d

3 files changed

Lines changed: 10 additions & 57 deletions

File tree

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ packages = ["src/evalwire"]
5454
[tool.pytest.ini_options]
5555
testpaths = ["tests"]
5656
asyncio_mode = "auto"
57+
filterwarnings = [
58+
"ignore::DeprecationWarning:ldap3",
59+
"ignore::DeprecationWarning:phoenix.evals",
60+
"ignore::DeprecationWarning:phoenix.server",
61+
"ignore::DeprecationWarning:phoenix.session",
62+
"ignore::DeprecationWarning:strawberry",
63+
"ignore::DeprecationWarning:pydantic",
64+
"ignore::DeprecationWarning:alembic",
65+
"ignore::sqlalchemy.exc.SAWarning",
66+
]
5767

5868
[dependency-groups]
5969
dev = [

tests/test_evaluators.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,6 @@ def test_bare_string_expected_output_no_match(self):
161161
assert is_in("cms", {"expected_output": "elasticsearch"}) is False
162162

163163

164-
# ---------------------------------------------------------------------------
165-
# TestMakeExactMatchEvaluator
166-
# ---------------------------------------------------------------------------
167-
168-
169164
class TestMakeExactMatchEvaluator:
170165
def test_returns_callable_named_exact_match(self):
171166
fn = make_exact_match_evaluator()
@@ -214,11 +209,6 @@ def test_only_first_expected_item_is_compared(self):
214209
assert exact_match("b", {"expected_output": ["a", "b"]}) is False
215210

216211

217-
# ---------------------------------------------------------------------------
218-
# TestMakeContainsEvaluator
219-
# ---------------------------------------------------------------------------
220-
221-
222212
class TestMakeContainsEvaluator:
223213
def test_returns_callable_named_contains(self):
224214
fn = make_contains_evaluator()
@@ -272,11 +262,6 @@ def test_inversion_pattern(self):
272262
assert contains("safe text", {"expected_output": ["forbidden"]}) is not True
273263

274264

275-
# ---------------------------------------------------------------------------
276-
# TestMakeRegexEvaluator
277-
# ---------------------------------------------------------------------------
278-
279-
280265
class TestMakeRegexEvaluator:
281266
def test_returns_callable_named_regex_match(self):
282267
fn = make_regex_evaluator()
@@ -339,11 +324,6 @@ def test_invalid_regex_raises_re_error(self):
339324
regex_match("hello", {"expected_output": ["[invalid"]})
340325

341326

342-
# ---------------------------------------------------------------------------
343-
# TestMakeJsonMatchEvaluator
344-
# ---------------------------------------------------------------------------
345-
346-
347327
class TestMakeJsonMatchEvaluator:
348328
def test_returns_callable_named_json_match(self):
349329
fn = make_json_match_evaluator()
@@ -435,10 +415,6 @@ def test_extra_keys_in_output_are_ignored(self):
435415
) == pytest.approx(1.0)
436416

437417

438-
# ---------------------------------------------------------------------------
439-
# TestMakeSchemaEvaluator
440-
# ---------------------------------------------------------------------------
441-
442418
_SIMPLE_SCHEMA = {
443419
"type": "object",
444420
"properties": {
@@ -503,11 +479,6 @@ def test_jsonschema_absent_raises_import_error(
503479
make_schema_evaluator(_SIMPLE_SCHEMA)
504480

505481

506-
# ---------------------------------------------------------------------------
507-
# TestMakeNumericToleranceEvaluator
508-
# ---------------------------------------------------------------------------
509-
510-
511482
class TestMakeNumericToleranceEvaluator:
512483
def test_returns_callable_named_numeric_close(self):
513484
fn = make_numeric_tolerance_evaluator()
@@ -578,11 +549,6 @@ def test_bare_string_expected(self):
578549
assert numeric_close("2.718", {"expected_output": "2.72"}) is True
579550

580551

581-
# ---------------------------------------------------------------------------
582-
# TestMakeLlmJudgeEvaluator
583-
# ---------------------------------------------------------------------------
584-
585-
586552
def _make_mock_model(return_value: object) -> MagicMock:
587553
"""Build a MagicMock that satisfies BaseChatModel.with_structured_output."""
588554
chain = MagicMock()
@@ -688,8 +654,6 @@ def test_missing_expected_key_sends_empty_string(self):
688654
prompt_used = chain.invoke.call_args[0][0]
689655
assert "Expected: \n" in prompt_used
690656

691-
# -- on_error="silent" ---------------------------------------------------
692-
693657
def test_on_error_silent_float_returns_zero(self):
694658
model = _make_mock_model(_FloatVerdict(1.0))
695659
chain = model.with_structured_output.return_value
@@ -716,8 +680,6 @@ def test_on_error_silent_bool_returns_false(self):
716680
result = llm_judge("output", {"expected_output": ["ref"]})
717681
assert result is False
718682

719-
# -- on_error="reraise" --------------------------------------------------
720-
721683
def test_on_error_reraise_calls_callback_and_reraises(self):
722684
model = _make_mock_model(_FloatVerdict(1.0))
723685
chain = model.with_structured_output.return_value

tests/test_task_async.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,10 @@
77

88
from __future__ import annotations
99

10-
from typing import TYPE_CHECKING
1110
from unittest.mock import AsyncMock, MagicMock, patch
1211

1312
import pytest
1413

15-
if TYPE_CHECKING:
16-
pass
17-
18-
19-
# ---------------------------------------------------------------------------
20-
# Helpers
21-
# ---------------------------------------------------------------------------
22-
2314

2415
def _make_example(input_: dict, output: dict | None = None) -> MagicMock:
2516
"""Return a lightweight stand-in for ``phoenix.experiments.types.Example``."""
@@ -29,11 +20,6 @@ def _make_example(input_: dict, output: dict | None = None) -> MagicMock:
2920
return ex
3021

3122

32-
# ---------------------------------------------------------------------------
33-
# Tests: async task callable contract
34-
# ---------------------------------------------------------------------------
35-
36-
3723
class TestAsyncTaskCallable:
3824
"""Verify that async task functions can be awaited and return correct values."""
3925

@@ -94,11 +80,6 @@ async def task(example) -> list[str]:
9480
await task(example)
9581

9682

97-
# ---------------------------------------------------------------------------
98-
# Tests: invoke_node directly (exercises the async path in evalwire.langgraph)
99-
# ---------------------------------------------------------------------------
100-
101-
10283
class TestInvokeNodeAsync:
10384
"""Exercise evalwire.langgraph.invoke_node as an async function."""
10485

0 commit comments

Comments
 (0)