summaryrefslogtreecommitdiff
path: root/c/test_c.py
diff options
context:
space:
mode:
Diffstat (limited to 'c/test_c.py')
-rw-r--r--c/test_c.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/c/test_c.py b/c/test_c.py
index fb97044..6c2e5a7 100644
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -1366,6 +1366,8 @@ def test_callback_exception():
try:
linecache.getline = lambda *args: 'LINE' # hack: speed up PyPy tests
sys.stderr = cStringIO.StringIO()
+ if hasattr(sys, '__unraisablehook__'): # work around pytest
+ sys.unraisablehook = sys.__unraisablehook__ # on recent CPythons
assert f(100) == 300
assert sys.stderr.getvalue() == ''
assert f(10000) == -42