1414from __future__ import annotations
1515
1616import json
17- import logging
1817import os
1918from pathlib import Path
2019from typing import Any
@@ -123,8 +122,7 @@ def _cleanup_globals() -> Any:
123122def test_pattern_matching (case : dict [str , Any ]) -> None :
124123 result = match_pattern (case ["pattern" ], case ["value" ])
125124 assert result == case ["expected" ], (
126- f"match_pattern({ case ['pattern' ]!r} , { case ['value' ]!r} ) "
127- f"returned { result } , expected { case ['expected' ]} "
125+ f"match_pattern({ case ['pattern' ]!r} , { case ['value' ]!r} ) " f"returned { result } , expected { case ['expected' ]} "
128126 )
129127
130128
@@ -143,8 +141,7 @@ def test_pattern_matching(case: dict[str, Any]) -> None:
143141def test_specificity (case : dict [str , Any ]) -> None :
144142 score = calculate_specificity (case ["pattern" ])
145143 assert score == case ["expected_score" ], (
146- f"calculate_specificity({ case ['pattern' ]!r} ) "
147- f"returned { score } , expected { case ['expected_score' ]} "
144+ f"calculate_specificity({ case ['pattern' ]!r} ) " f"returned { score } , expected { case ['expected_score' ]} "
148145 )
149146
150147
@@ -396,10 +393,7 @@ def test_config_env(case: dict[str, Any], monkeypatch: pytest.MonkeyPatch) -> No
396393 result = str (result ).lower ()
397394 if expected is not None :
398395 expected = str (expected ).lower ()
399- assert result == expected , (
400- f"config.get({ case ['expected_path' ]!r} ) = { result !r} , "
401- f"expected { expected !r} "
402- )
396+ assert result == expected , f"config.get({ case ['expected_path' ]!r} ) = { result !r} , " f"expected { expected !r} "
403397
404398
405399# ---------------------------------------------------------------------------
@@ -579,14 +573,11 @@ def test_schema_validation(
579573
580574 result = validator .validate (input_data , model )
581575 assert result .valid == expected_valid , (
582- f"schema_validate({ case ['id' ]} ) valid={ result .valid } , "
583- f"expected={ expected_valid } , errors={ result .errors } "
576+ f"schema_validate({ case ['id' ]} ) valid={ result .valid } , " f"expected={ expected_valid } , errors={ result .errors } "
584577 )
585578
586579 # Verify error path when expected
587580 if not expected_valid and "expected_error_path" in case :
588581 error_paths = [e .path for e in result .errors ]
589582 expected_path = "/" + case ["expected_error_path" ].replace ("." , "/" ).replace ("[" , "/" ).replace ("]" , "" )
590- assert any (expected_path in p for p in error_paths ), (
591- f"Expected error at { expected_path } , got { error_paths } "
592- )
583+ assert any (expected_path in p for p in error_paths ), f"Expected error at { expected_path } , got { error_paths } "
0 commit comments