summaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2021-06-20 20:31:53 +0200
committerArmin Rigo <arigo@tunes.org>2021-06-20 20:31:53 +0200
commit1d2de7dc29904d571069b947d3ec0d5b5dbed19c (patch)
treee8c1635762dd410216a4bb487ac4c3dd2586db94 /c
parent1531a5c0c27cbc8c17bb721b936899c9ce24f329 (diff)
downloadcffi-1d2de7dc29904d571069b947d3ec0d5b5dbed19c.tar.gz
fix tests for py.test running on CPython v3.10.0b3
Diffstat (limited to 'c')
-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