def test_5XX(self): status_code = 502 with pytest.raises(GitHubBroken) as exc_info: sansio.decipher_response(status_code, {}, b'') assert exc_info.value.status_code == http.HTTPStatus(status_code)