Skip to content

Commit ee4a505

Browse files
committed
tests - adapt
1 parent a6da09a commit ee4a505

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tests/path_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ def test_paths_tags(httpx_mock, with_paths_tags):
486486

487487

488488
def test_paths_response_status_pattern_default(httpx_mock, with_paths_response_status_pattern_default):
489-
api = OpenAPI("/", with_paths_response_status_pattern_default, session_factory=httpx.Client, raise_on_error=False)
489+
api = OpenAPI("/", with_paths_response_status_pattern_default, session_factory=httpx.Client)
490+
api.raise_on_http_status = []
490491

491492
httpx_mock.add_response(headers={"Content-Type": "application/json"}, status_code=201, json="created")
492493
r = api._.test()
@@ -511,7 +512,7 @@ def test_paths_response_status_pattern_default(httpx_mock, with_paths_response_s
511512
api._.test()
512513

513514

514-
def test_paths_response_error(httpx_mock, with_paths_response_error_vXX):
515+
def test_paths_response_error(mocker, httpx_mock, with_paths_response_error_vXX):
515516
from aiopenapi3 import ResponseSchemaError, ContentTypeError, HTTPStatusError, ResponseDecodingError
516517

517518
api = OpenAPI("/", with_paths_response_error_vXX, session_factory=httpx.Client)
@@ -545,7 +546,7 @@ def test_paths_response_error(httpx_mock, with_paths_response_error_vXX):
545546
api._.test()
546547

547548
httpx_mock.add_response(headers={"Content-Type": "application/json", "X-required": "1"}, status_code=437, json="ok")
548-
api._raise_on_error = False
549+
mocker.patch.object(api, "raise_on_http_status", return_value=[], autospec=True)
549550
api._.test()
550551

551552

tests/petstore_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def api():
9292
api = OpenAPI.load_sync(
9393
url, plugins=[OnDocument(), OnMessage()], session_factory=session_factory, use_operation_tags=False
9494
)
95+
api.raise_on_http_status = []
9596
api.authenticate(api_key="special-key")
9697
return api
9798

tests/petstorev3_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def api():
112112
plugins = [OnDocument(), OnMessage()]
113113
api = OpenAPI.load_sync(url, plugins=plugins, session_factory=session_factory, use_operation_tags=False)
114114
api.authenticate(api_key="special-key")
115+
api.raise_on_http_status = []
115116
return api
116117

117118

0 commit comments

Comments
 (0)