test(test_openai_endpoints.py): make test stricter

This commit is contained in:
Krrish Dholakia 2024-04-20 12:11:54 -07:00
parent 47e9d5f2ec
commit 1507b23e30
2 changed files with 7 additions and 4 deletions

View file

@ -260,7 +260,10 @@ async def test_chat_completion_ratelimit():
await asyncio.gather(*tasks)
pytest.fail("Expected at least 1 call to fail")
except Exception as e:
pass
if "Request did not return a 200 status code: 429" in str(e):
pass
else:
pytest.fail(f"Wrong error received - {str(e)}")
@pytest.mark.asyncio