Skip to content

Commit e2c0eb3

Browse files
committed
fix(tests): make flaky time-limit test more flexible
1 parent 89aa16c commit e2c0eb3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/test_web_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ def test_g2p_exceeds_time_limit(self):
125125
with redirect_stderr(StringIO()):
126126
response = self.API_CLIENT.post("/api/v1/assemble", json=request)
127127
self.assertEqual(response.status_code, 422)
128-
self.assertIn(
129-
"g2p conversion exceeded time limit", response.json()["detail"]
130-
)
128+
# But still let the test pass if it's the preprocessing that fails by
129+
# asserting the common substring of the two possible failure messages.
130+
self.assertIn("exceeded time limit", response.json()["detail"])
131131

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

0 commit comments

Comments
 (0)