@@ -150,8 +150,9 @@ def test_full_cycle(server_url: str) -> None:
150150
151151 session .delete (object_key )
152152
153- with pytest .raises (RequestError , check = lambda e : e . status == 404 ) :
153+ with pytest .raises (RequestError ) as exc_info :
154154 session .get (object_key )
155+ assert exc_info .value .status == 404
155156
156157
157158def test_full_cycle_uncompressed (server_url : str ) -> None :
@@ -210,8 +211,9 @@ def test_not_found_with_different_scope(server_url: str) -> None:
210211
211212 # Now make sure we can't fetch it
212213 session = client .session (test_usecase , org = 42 , project = 9999 )
213- with pytest .raises (RequestError , check = lambda e : e . status == 404 ) :
214+ with pytest .raises (RequestError ) as exc_info :
214215 session .get (object_key )
216+ assert exc_info .value .status == 404
215217
216218
217219def test_fails_with_insufficient_auth_perms (server_url : str ) -> None :
@@ -225,8 +227,9 @@ def test_fails_with_insufficient_auth_perms(server_url: str) -> None:
225227
226228 session = client .session (test_usecase , org = 42 , project = 1337 )
227229
228- with pytest .raises (RequestError , check = lambda e : e . status == 403 ) :
230+ with pytest .raises (RequestError ) as exc_info :
229231 _object_key = session .put (b"test data" )
232+ assert exc_info .value .status == 403
230233
231234
232235def test_read_timeout () -> None :
0 commit comments