Skip to content

Commit 4f58e18

Browse files
committed
chore(tests): ensure parse method is in sync with create
1 parent 05590ec commit 4f58e18

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/api_resources/test_responses.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from openai import OpenAI, AsyncOpenAI
1111
from tests.utils import assert_matches_type
12+
from openai._utils import assert_signatures_in_sync
1213
from openai.types.responses import (
1314
Response,
1415
)
@@ -340,6 +341,17 @@ def test_path_params_cancel(self, client: OpenAI) -> None:
340341
)
341342

342343

344+
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
345+
def test_parse_method_in_sync(sync: bool, client: OpenAI, async_client: AsyncOpenAI) -> None:
346+
checking_client: OpenAI | AsyncOpenAI = client if sync else async_client
347+
348+
assert_signatures_in_sync(
349+
checking_client.responses.create,
350+
checking_client.responses.parse,
351+
exclude_params={"stream", "tools"},
352+
)
353+
354+
343355
class TestAsyncResponses:
344356
parametrize = pytest.mark.parametrize(
345357
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]

0 commit comments

Comments
 (0)