@@ -115,7 +115,8 @@ def test_get_pets_response(self, spec, response_validator):
115115 path_pattern = path_pattern , args = query_params ,
116116 )
117117
118- parameters = spec_validate_parameters (spec , request )
118+ with pytest .warns (DeprecationWarning ):
119+ parameters = spec_validate_parameters (spec , request )
119120 body = spec_validate_body (spec , request )
120121
121122 assert parameters == Parameters (
@@ -161,7 +162,8 @@ def test_get_pets_response_no_schema(self, spec, response_validator):
161162 path_pattern = path_pattern , args = query_params ,
162163 )
163164
164- parameters = spec_validate_parameters (spec , request )
165+ with pytest .warns (DeprecationWarning ):
166+ parameters = spec_validate_parameters (spec , request )
165167 body = spec_validate_body (spec , request )
166168
167169 assert parameters == Parameters (
@@ -176,7 +178,8 @@ def test_get_pets_response_no_schema(self, spec, response_validator):
176178 data = '<html></html>'
177179 response = MockResponse (data , status_code = 404 , mimetype = 'text/html' )
178180
179- response_result = response_validator .validate (request , response )
181+ with pytest .warns (UserWarning ):
182+ response_result = response_validator .validate (request , response )
180183
181184 assert response_result .errors == []
182185 assert response_result .data == data
@@ -193,7 +196,8 @@ def test_get_pets_invalid_response(self, spec, response_validator):
193196 path_pattern = path_pattern , args = query_params ,
194197 )
195198
196- parameters = spec_validate_parameters (spec , request )
199+ with pytest .warns (DeprecationWarning ):
200+ parameters = spec_validate_parameters (spec , request )
197201 body = spec_validate_body (spec , request )
198202
199203 assert parameters == Parameters (
@@ -246,7 +250,8 @@ def test_get_pets_ids_param(self, spec, response_validator):
246250 path_pattern = path_pattern , args = query_params ,
247251 )
248252
249- parameters = spec_validate_parameters (spec , request )
253+ with pytest .warns (DeprecationWarning ):
254+ parameters = spec_validate_parameters (spec , request )
250255 body = spec_validate_body (spec , request )
251256
252257 assert parameters == Parameters (
@@ -284,7 +289,8 @@ def test_get_pets_tags_param(self, spec, response_validator):
284289 path_pattern = path_pattern , args = query_params ,
285290 )
286291
287- parameters = spec_validate_parameters (spec , request )
292+ with pytest .warns (DeprecationWarning ):
293+ parameters = spec_validate_parameters (spec , request )
288294 body = spec_validate_body (spec , request )
289295
290296 assert parameters == Parameters (
@@ -322,8 +328,9 @@ def test_get_pets_parameter_deserialization_error(self, spec):
322328 path_pattern = path_pattern , args = query_params ,
323329 )
324330
325- with pytest .raises (DeserializeError ):
326- spec_validate_parameters (spec , request )
331+ with pytest .warns (DeprecationWarning ):
332+ with pytest .raises (DeserializeError ):
333+ spec_validate_parameters (spec , request )
327334
328335 body = spec_validate_body (spec , request )
329336
@@ -341,8 +348,9 @@ def test_get_pets_wrong_parameter_type(self, spec):
341348 path_pattern = path_pattern , args = query_params ,
342349 )
343350
344- with pytest .raises (CastError ):
345- spec_validate_parameters (spec , request )
351+ with pytest .warns (DeprecationWarning ):
352+ with pytest .raises (CastError ):
353+ spec_validate_parameters (spec , request )
346354
347355 body = spec_validate_body (spec , request )
348356
@@ -356,8 +364,9 @@ def test_get_pets_raises_missing_required_param(self, spec):
356364 path_pattern = path_pattern ,
357365 )
358366
359- with pytest .raises (MissingRequiredParameter ):
360- spec_validate_parameters (spec , request )
367+ with pytest .warns (DeprecationWarning ):
368+ with pytest .raises (MissingRequiredParameter ):
369+ spec_validate_parameters (spec , request )
361370
362371 body = spec_validate_body (spec , request )
363372
@@ -375,8 +384,9 @@ def test_get_pets_empty_value(self, spec):
375384 path_pattern = path_pattern , args = query_params ,
376385 )
377386
378- with pytest .raises (EmptyQueryParameterValue ):
379- spec_validate_parameters (spec , request )
387+ with pytest .warns (DeprecationWarning ):
388+ with pytest .raises (EmptyQueryParameterValue ):
389+ spec_validate_parameters (spec , request )
380390 body = spec_validate_body (spec , request )
381391
382392 assert body is None
@@ -421,7 +431,8 @@ def test_get_pets_none_value(self, spec):
421431 path_pattern = path_pattern , args = query_params ,
422432 )
423433
424- parameters = spec_validate_parameters (spec , request )
434+ with pytest .warns (DeprecationWarning ):
435+ parameters = spec_validate_parameters (spec , request )
425436
426437 assert parameters == Parameters (
427438 query = {
@@ -448,7 +459,8 @@ def test_get_pets_param_order(self, spec):
448459 path_pattern = path_pattern , args = query_params ,
449460 )
450461
451- parameters = spec_validate_parameters (spec , request )
462+ with pytest .warns (DeprecationWarning ):
463+ parameters = spec_validate_parameters (spec , request )
452464
453465 assert parameters == Parameters (
454466 query = {
@@ -480,7 +492,8 @@ def test_get_pets_param_coordinates(self, spec):
480492 path_pattern = path_pattern , args = query_params ,
481493 )
482494
483- parameters = spec_validate_parameters (spec , request )
495+ with pytest .warns (DeprecationWarning ):
496+ parameters = spec_validate_parameters (spec , request )
484497
485498 assert parameters == Parameters (
486499 query = {
@@ -1040,7 +1053,8 @@ def test_get_pet_wildcard(self, spec, response_validator):
10401053 data = b'imagedata'
10411054 response = MockResponse (data , mimetype = 'image/png' )
10421055
1043- response_result = response_validator .validate (request , response )
1056+ with pytest .warns (UserWarning ):
1057+ response_result = response_validator .validate (request , response )
10441058
10451059 assert response_result .errors == []
10461060 assert response_result .data == data
@@ -1353,7 +1367,8 @@ def test_delete_tags_with_requestbody(
13531367 assert response_result .errors == []
13541368 assert response_result .data is None
13551369
1356- response_headers = spec_validate_headers (spec , request , response )
1370+ with pytest .warns (DeprecationWarning ):
1371+ response_headers = spec_validate_headers (spec , request , response )
13571372
13581373 assert response_headers == {
13591374 'x-delete-confirm' : True ,
@@ -1392,7 +1407,9 @@ def test_delete_tags_raises_missing_required_response_header(
13921407 data = None
13931408 response = MockResponse (data , status_code = 200 )
13941409
1395- response_result = response_validator .validate (request , response )
1410+ with pytest .warns (DeprecationWarning ):
1411+ response_result = response_validator .validate (request , response )
1412+
13961413 assert response_result .errors == [
13971414 MissingRequiredHeader (name = 'x-delete-confirm' ),
13981415 ]
0 commit comments