diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c18333e..1b4d3bf 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.19.2" + ".": "0.19.3" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index da767b5..d3f723c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 5 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-8cedb48141daf72e4c1a8b29dad13fb1025dd5edad384296be4bd28277b8d7cc.yml -openapi_spec_hash: 306db110474ab42cf13c1ce7cf178cb3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-baf5ebdd05d1b5192759a356c2701131c47cfb5b7239a49fcb94e68d4210648c.yml +openapi_spec_hash: 6ea786d56726e18156adf57915fcbe5f config_hash: 9040e7359f066240ad536041fb2c5185 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cd52c6..f7365b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 0.19.3 (2026-03-03) + +Full Changelog: [v0.19.2...v0.19.3](https://github.com/isaacus-dev/isaacus-python/compare/v0.19.2...v0.19.3) + +### Chores + +* **internal:** add request options to SSE classes ([c17f87b](https://github.com/isaacus-dev/isaacus-python/commit/c17f87bb554fb2f897d8aff7d871ba4710f144dd)) +* **internal:** make `test_proxy_environment_variables` more resilient ([6f2864d](https://github.com/isaacus-dev/isaacus-python/commit/6f2864d438b493b7fa5e78c7f3aac1066ac2b19c)) +* **internal:** make `test_proxy_environment_variables` more resilient to env ([6af2338](https://github.com/isaacus-dev/isaacus-python/commit/6af233851808d5c3995063047a369588a7b7749c)) +* **internal:** remove mock server code ([e586a7f](https://github.com/isaacus-dev/isaacus-python/commit/e586a7f29f0fb1ed92f593da9a3fd6086b074004)) +* update mock server docs ([4bd2467](https://github.com/isaacus-dev/isaacus-python/commit/4bd2467c4ba212c2661dc4b0fab8a17fbea7a431)) + ## 0.19.2 (2026-02-18) Full Changelog: [v0.19.1...v0.19.2](https://github.com/isaacus-dev/isaacus-python/compare/v0.19.1...v0.19.2) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a324095..e2fb7d0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,13 +85,6 @@ $ pip install ./path-to-wheel-file.whl ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. - -```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml -``` - ```sh $ ./scripts/test ``` diff --git a/pyproject.toml b/pyproject.toml index 4ba445e..5e636a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "isaacus" -version = "0.19.2" +version = "0.19.3" description = "The official Python library for the isaacus API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/scripts/mock b/scripts/mock deleted file mode 100755 index 0b28f6e..0000000 --- a/scripts/mock +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -if [[ -n "$1" && "$1" != '--'* ]]; then - URL="$1" - shift -else - URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" -fi - -# Check if the URL is empty -if [ -z "$URL" ]; then - echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" - exit 1 -fi - -echo "==> Starting mock server with URL ${URL}" - -# Run prism mock on the given spec -if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - - # Wait for server to come online - echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do - echo -n "." - sleep 0.1 - done - - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - - echo -else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" -fi diff --git a/scripts/test b/scripts/test index dbeda2d..39729d0 100755 --- a/scripts/test +++ b/scripts/test @@ -4,53 +4,7 @@ set -e cd "$(dirname "$0")/.." -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -kill_server_on_port() { - pids=$(lsof -t -i tcp:"$1" || echo "") - if [ "$pids" != "" ]; then - kill "$pids" - echo "Stopped $pids." - fi -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if ! is_overriding_api_base_url && ! prism_is_running ; then - # When we exit this script, make sure to kill the background mock server process - trap 'kill_server_on_port 4010' EXIT - - # Start the dev server - ./scripts/mock --daemon -fi - -if is_overriding_api_base_url ; then - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" - echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo -fi export DEFER_PYDANTIC_BUILD=false diff --git a/src/isaacus/_response.py b/src/isaacus/_response.py index 392418a..1765ace 100644 --- a/src/isaacus/_response.py +++ b/src/isaacus/_response.py @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/isaacus/_streaming.py b/src/isaacus/_streaming.py index 6e5dfdb..647d637 100644 --- a/src/isaacus/_streaming.py +++ b/src/isaacus/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ._client import Isaacus, AsyncIsaacus + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -22,7 +23,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -31,10 +32,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: Isaacus, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -94,10 +97,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncIsaacus, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() diff --git a/src/isaacus/_version.py b/src/isaacus/_version.py index a05e052..c406bb8 100644 --- a/src/isaacus/_version.py +++ b/src/isaacus/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "isaacus" -__version__ = "0.19.2" # x-release-please-version +__version__ = "0.19.3" # x-release-please-version diff --git a/tests/api_resources/classifications/test_universal.py b/tests/api_resources/classifications/test_universal.py index a6595d4..215db24 100644 --- a/tests/api_resources/classifications/test_universal.py +++ b/tests/api_resources/classifications/test_universal.py @@ -17,7 +17,7 @@ class TestUniversal: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Isaacus) -> None: universal = client.classifications.universal.create( @@ -27,7 +27,7 @@ def test_method_create(self, client: Isaacus) -> None: ) assert_matches_type(UniversalClassificationResponse, universal, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Isaacus) -> None: universal = client.classifications.universal.create( @@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: ) assert_matches_type(UniversalClassificationResponse, universal, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Isaacus) -> None: response = client.classifications.universal.with_raw_response.create( @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Isaacus) -> None: universal = response.parse() assert_matches_type(UniversalClassificationResponse, universal, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Isaacus) -> None: with client.classifications.universal.with_streaming_response.create( @@ -80,7 +80,7 @@ class TestAsyncUniversal: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncIsaacus) -> None: universal = await async_client.classifications.universal.create( @@ -90,7 +90,7 @@ async def test_method_create(self, async_client: AsyncIsaacus) -> None: ) assert_matches_type(UniversalClassificationResponse, universal, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -> None: universal = await async_client.classifications.universal.create( @@ -107,7 +107,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - ) assert_matches_type(UniversalClassificationResponse, universal, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: response = await async_client.classifications.universal.with_raw_response.create( @@ -121,7 +121,7 @@ async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: universal = await response.parse() assert_matches_type(UniversalClassificationResponse, universal, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncIsaacus) -> None: async with async_client.classifications.universal.with_streaming_response.create( diff --git a/tests/api_resources/extractions/test_qa.py b/tests/api_resources/extractions/test_qa.py index 029690a..a76e06d 100644 --- a/tests/api_resources/extractions/test_qa.py +++ b/tests/api_resources/extractions/test_qa.py @@ -17,7 +17,7 @@ class TestQA: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Isaacus) -> None: qa = client.extractions.qa.create( @@ -29,7 +29,7 @@ def test_method_create(self, client: Isaacus) -> None: ) assert_matches_type(AnswerExtractionResponse, qa, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Isaacus) -> None: qa = client.extractions.qa.create( @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: ) assert_matches_type(AnswerExtractionResponse, qa, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Isaacus) -> None: response = client.extractions.qa.with_raw_response.create( @@ -64,7 +64,7 @@ def test_raw_response_create(self, client: Isaacus) -> None: qa = response.parse() assert_matches_type(AnswerExtractionResponse, qa, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Isaacus) -> None: with client.extractions.qa.with_streaming_response.create( @@ -88,7 +88,7 @@ class TestAsyncQA: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncIsaacus) -> None: qa = await async_client.extractions.qa.create( @@ -100,7 +100,7 @@ async def test_method_create(self, async_client: AsyncIsaacus) -> None: ) assert_matches_type(AnswerExtractionResponse, qa, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -> None: qa = await async_client.extractions.qa.create( @@ -119,7 +119,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - ) assert_matches_type(AnswerExtractionResponse, qa, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: response = await async_client.extractions.qa.with_raw_response.create( @@ -135,7 +135,7 @@ async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: qa = await response.parse() assert_matches_type(AnswerExtractionResponse, qa, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncIsaacus) -> None: async with async_client.extractions.qa.with_streaming_response.create( diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py index af293c5..5ae4bce 100644 --- a/tests/api_resources/test_embeddings.py +++ b/tests/api_resources/test_embeddings.py @@ -17,7 +17,7 @@ class TestEmbeddings: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Isaacus) -> None: embedding = client.embeddings.create( @@ -26,7 +26,7 @@ def test_method_create(self, client: Isaacus) -> None: ) assert_matches_type(EmbeddingResponse, embedding, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Isaacus) -> None: embedding = client.embeddings.create( @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: ) assert_matches_type(EmbeddingResponse, embedding, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Isaacus) -> None: response = client.embeddings.with_raw_response.create( @@ -51,7 +51,7 @@ def test_raw_response_create(self, client: Isaacus) -> None: embedding = response.parse() assert_matches_type(EmbeddingResponse, embedding, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Isaacus) -> None: with client.embeddings.with_streaming_response.create( @@ -72,7 +72,7 @@ class TestAsyncEmbeddings: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncIsaacus) -> None: embedding = await async_client.embeddings.create( @@ -81,7 +81,7 @@ async def test_method_create(self, async_client: AsyncIsaacus) -> None: ) assert_matches_type(EmbeddingResponse, embedding, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -> None: embedding = await async_client.embeddings.create( @@ -93,7 +93,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - ) assert_matches_type(EmbeddingResponse, embedding, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: response = await async_client.embeddings.with_raw_response.create( @@ -106,7 +106,7 @@ async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: embedding = await response.parse() assert_matches_type(EmbeddingResponse, embedding, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncIsaacus) -> None: async with async_client.embeddings.with_streaming_response.create( diff --git a/tests/api_resources/test_enrichments.py b/tests/api_resources/test_enrichments.py index eac10a9..18ab2d8 100644 --- a/tests/api_resources/test_enrichments.py +++ b/tests/api_resources/test_enrichments.py @@ -17,7 +17,7 @@ class TestEnrichments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Isaacus) -> None: enrichment = client.enrichments.create( @@ -26,7 +26,7 @@ def test_method_create(self, client: Isaacus) -> None: ) assert_matches_type(EnrichmentResponse, enrichment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Isaacus) -> None: enrichment = client.enrichments.create( @@ -36,7 +36,7 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: ) assert_matches_type(EnrichmentResponse, enrichment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Isaacus) -> None: response = client.enrichments.with_raw_response.create( @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Isaacus) -> None: enrichment = response.parse() assert_matches_type(EnrichmentResponse, enrichment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Isaacus) -> None: with client.enrichments.with_streaming_response.create( @@ -70,7 +70,7 @@ class TestAsyncEnrichments: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncIsaacus) -> None: enrichment = await async_client.enrichments.create( @@ -79,7 +79,7 @@ async def test_method_create(self, async_client: AsyncIsaacus) -> None: ) assert_matches_type(EnrichmentResponse, enrichment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -> None: enrichment = await async_client.enrichments.create( @@ -89,7 +89,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - ) assert_matches_type(EnrichmentResponse, enrichment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: response = await async_client.enrichments.with_raw_response.create( @@ -102,7 +102,7 @@ async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: enrichment = await response.parse() assert_matches_type(EnrichmentResponse, enrichment, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncIsaacus) -> None: async with async_client.enrichments.with_streaming_response.create( diff --git a/tests/api_resources/test_rerankings.py b/tests/api_resources/test_rerankings.py index 36707ac..fb37da6 100644 --- a/tests/api_resources/test_rerankings.py +++ b/tests/api_resources/test_rerankings.py @@ -17,7 +17,7 @@ class TestRerankings: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Isaacus) -> None: reranking = client.rerankings.create( @@ -33,7 +33,7 @@ def test_method_create(self, client: Isaacus) -> None: ) assert_matches_type(RerankingResponse, reranking, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Isaacus) -> None: reranking = client.rerankings.create( @@ -57,7 +57,7 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None: ) assert_matches_type(RerankingResponse, reranking, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Isaacus) -> None: response = client.rerankings.with_raw_response.create( @@ -77,7 +77,7 @@ def test_raw_response_create(self, client: Isaacus) -> None: reranking = response.parse() assert_matches_type(RerankingResponse, reranking, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Isaacus) -> None: with client.rerankings.with_streaming_response.create( @@ -105,7 +105,7 @@ class TestAsyncRerankings: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncIsaacus) -> None: reranking = await async_client.rerankings.create( @@ -121,7 +121,7 @@ async def test_method_create(self, async_client: AsyncIsaacus) -> None: ) assert_matches_type(RerankingResponse, reranking, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -> None: reranking = await async_client.rerankings.create( @@ -145,7 +145,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) - ) assert_matches_type(RerankingResponse, reranking, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: response = await async_client.rerankings.with_raw_response.create( @@ -165,7 +165,7 @@ async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None: reranking = await response.parse() assert_matches_type(RerankingResponse, reranking, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncIsaacus) -> None: async with async_client.rerankings.with_streaming_response.create( diff --git a/tests/test_client.py b/tests/test_client.py index 841655d..ac88537 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -962,6 +962,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has any proxy env vars set + monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultHttpxClient() @@ -1883,6 +1891,14 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has any proxy env vars set + monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultAsyncHttpxClient()