Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
commonism committed Dec 21, 2024
1 parent 3f28ac8 commit b7d063d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/error_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import pytest


def test_response_error(httpx_mock, with_paths_response_error):
api = OpenAPI("/", with_paths_response_error, session_factory=httpx.Client)
def test_response_error(httpx_mock, with_paths_response_error_vXX):
api = OpenAPI("/", with_paths_response_error_vXX, session_factory=httpx.Client)

httpx_mock.add_response(headers={"Content-Type": "application/json"}, status_code=200, json="ok")
r = api._.test()
Expand All @@ -35,7 +35,7 @@ def test_response_error(httpx_mock, with_paths_response_error):
str(e.value)


def test_request_error(with_paths_response_error):
def test_request_error(with_paths_response_error_vXX):
class Client(httpx.Client):
def __init__(self, *args, **kwargs):
super().__init__(*args, transport=RaisingTransport(), **kwargs)
Expand All @@ -44,7 +44,7 @@ class RaisingTransport(httpx.BaseTransport):
def handle_request(self, request):
raise httpx.TimeoutException(message="timeout")

api = OpenAPI("/", with_paths_response_error, session_factory=Client)
api = OpenAPI("/", with_paths_response_error_vXX, session_factory=Client)

with pytest.raises(RequestError) as e:
api._.test()
Expand Down

0 comments on commit b7d063d

Please sign in to comment.