Skip to content

Commit

Permalink
fix(tests): make flaky time-limit test more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
joanise committed Feb 28, 2025
1 parent 89aa16c commit e2c0eb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_web_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ def test_g2p_exceeds_time_limit(self):
with redirect_stderr(StringIO()):
response = self.API_CLIENT.post("/api/v1/assemble", json=request)
self.assertEqual(response.status_code, 422)
self.assertIn(
"g2p conversion exceeded time limit", response.json()["detail"]
)
# But still let the test pass if it's the preprocessing that fails by
# asserting the common substring of the two possible failure messages.
self.assertIn("exceeded time limit", response.json()["detail"])

def test_prepro_exceeds_time_limit(self):
# preprocessing takes about 5 ms, so 1 micros is guaranteed to be too short on any hardware.
Expand Down

0 comments on commit e2c0eb3

Please sign in to comment.