Skip to content

Commit 0e50c45

Browse files
committed
Workaround for PyPy
1 parent d2e78b0 commit 0e50c45

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

tests/test_exceptions.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,20 @@ def test_flaky_exception_failure_point_str():
327327
)
328328
assert not py_err_set_after_what
329329
lines = what.splitlines()
330-
assert lines[:5] == [
331-
"FlakyException: <MESSAGE UNAVAILABLE DUE TO ANOTHER EXCEPTION>",
332-
"",
333-
"MESSAGE UNAVAILABLE DUE TO EXCEPTION: ValueError: triggered_failure_point_str",
334-
"",
335-
"At:",
336-
]
330+
if env.PYPY and len(lines) == 3:
331+
n = 3 # Traceback is missing.
332+
else:
333+
n = 5
334+
assert (
335+
lines[:n]
336+
== [
337+
"FlakyException: <MESSAGE UNAVAILABLE DUE TO ANOTHER EXCEPTION>",
338+
"",
339+
"MESSAGE UNAVAILABLE DUE TO EXCEPTION: ValueError: triggered_failure_point_str",
340+
"",
341+
"At:",
342+
][:n]
343+
)
337344

338345

339346
def test_cross_module_interleaved_error_already_set():

0 commit comments

Comments
 (0)