diff --git a/tests/run/with_gil.pyx b/tests/run/with_gil.pyx
index 5a800f15b11fc34d3b8ed5bafd20a174161b294c..ef4599d751923197f7abe2352fec997f6644ae4c 100644
--- a/tests/run/with_gil.pyx
+++ b/tests/run/with_gil.pyx
@@ -276,10 +276,10 @@ cdef void void_nogil_nested_gil() nogil:
 def test_nogil_void_funcs_with_gil():
     """
     >>> redirect_stderr(test_nogil_void_funcs_with_gil)  # doctest: +ELLIPSIS
-    Exception ...ExceptionWithMsg: ExceptionWithMsg('This is swallowed') in 'with_gil.void_nogil_ignore_exception' ignored
+    Exception... ignored...
     Inner gil section
     nogil section
-    Exception ...ExceptionWithMsg: ExceptionWithMsg('Swallow this') in 'with_gil.void_nogil_nested_gil' ignored
+    Exception... ignored...
     """
     void_nogil_ignore_exception()
     void_nogil_nested_gil()
@@ -287,10 +287,10 @@ def test_nogil_void_funcs_with_gil():
 def test_nogil_void_funcs_with_nogil():
     """
     >>> redirect_stderr(test_nogil_void_funcs_with_nogil)  # doctest: +ELLIPSIS
-    Exception ...ExceptionWithMsg: ExceptionWithMsg('This is swallowed') in 'with_gil.void_nogil_ignore_exception' ignored
+    Exception... ignored...
     Inner gil section
     nogil section
-    Exception ...ExceptionWithMsg: ExceptionWithMsg('Swallow this') in 'with_gil.void_nogil_nested_gil' ignored
+    Exception... ignored...
     """
     with nogil:
         void_nogil_ignore_exception()