@@ -1273,7 +1273,7 @@ def test_not_image(cloud_reco_client: CloudRecoService) -> None:
12731273 """
12741274 not_image_data = b"not_image_data"
12751275
1276- with pytest .raises (BadImage ) as exc_info :
1276+ with pytest .raises (expected_exception = BadImage ) as exc_info :
12771277 cloud_reco_client .query (
12781278 image = io .BytesIO (initial_bytes = not_image_data )
12791279 )
@@ -1370,7 +1370,9 @@ def test_png(
13701370 assert image_content_size > max_bytes
13711371 assert (image_content_size * 0.95 ) < max_bytes
13721372
1373- with pytest .raises (RequestEntityTooLarge ) as exc_info :
1373+ with pytest .raises (
1374+ expected_exception = RequestEntityTooLarge
1375+ ) as exc_info :
13741376 cloud_reco_client .query (image = png_too_large )
13751377
13761378 response = exc_info .value .response
@@ -1447,7 +1449,9 @@ def test_jpeg(
14471449 assert image_content_size > max_bytes
14481450 assert (image_content_size * 0.95 ) < max_bytes
14491451
1450- with pytest .raises (RequestEntityTooLarge ) as exc_info :
1452+ with pytest .raises (
1453+ expected_exception = RequestEntityTooLarge
1454+ ) as exc_info :
14511455 cloud_reco_client .query (image = jpeg_too_large )
14521456
14531457 response = exc_info .value .response
@@ -1497,7 +1501,7 @@ def test_max_height(
14971501 height = max_height + 1 ,
14981502 )
14991503
1500- with pytest .raises (BadImage ) as exc_info :
1504+ with pytest .raises (expected_exception = BadImage ) as exc_info :
15011505 cloud_reco_client .query (image = png_too_tall )
15021506
15031507 response = exc_info .value .response
@@ -1550,7 +1554,7 @@ def test_max_width(cloud_reco_client: CloudRecoService) -> None:
15501554 height = height ,
15511555 )
15521556
1553- with pytest .raises (BadImage ) as exc_info :
1557+ with pytest .raises (expected_exception = BadImage ) as exc_info :
15541558 result = cloud_reco_client .query (image = png_too_wide )
15551559
15561560 response = exc_info .value .response
@@ -1634,7 +1638,7 @@ def test_unsupported(
16341638 pil_image .save (image_buffer , file_format )
16351639 image_content = image_buffer .getvalue ()
16361640
1637- with pytest .raises (BadImage ) as exc_info :
1641+ with pytest .raises (expected_exception = BadImage ) as exc_info :
16381642 cloud_reco_client .query (
16391643 image = io .BytesIO (initial_bytes = image_content )
16401644 )
@@ -1977,7 +1981,7 @@ def test_inactive_project(
19771981 """
19781982 If the project is inactive, a FORBIDDEN response is returned.
19791983 """
1980- with pytest .raises (InactiveProject ) as exc_info :
1984+ with pytest .raises (expected_exception = InactiveProject ) as exc_info :
19811985 inactive_cloud_reco_client .query (image = high_quality_image )
19821986
19831987 response = exc_info .value .response
0 commit comments