diff options
author | Matti Picus <matti.picus@gmail.com> | 2021-02-21 20:05:34 +0200 |
---|---|---|
committer | Matti Picus <matti.picus@gmail.com> | 2021-02-21 20:05:34 +0200 |
commit | 8e900f8ba82a7f2a1517d400b1e5f5c35dad2ad1 (patch) | |
tree | 2e86fed43093b6eb4ea6556ea585d4c5e27b4681 /extra_tests | |
parent | merge intbount-improvements-3 (diff) | |
download | pypy-8e900f8ba82a7f2a1517d400b1e5f5c35dad2ad1.tar.gz pypy-8e900f8ba82a7f2a1517d400b1e5f5c35dad2ad1.tar.bz2 pypy-8e900f8ba82a7f2a1517d400b1e5f5c35dad2ad1.zip |
update cffi to c16abb8f809f
Diffstat (limited to 'extra_tests')
-rw-r--r-- | extra_tests/cffi_tests/test_c.py | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/extra_tests/cffi_tests/test_c.py b/extra_tests/cffi_tests/test_c.py index 69ad15eb6c..788500e718 100644 --- a/extra_tests/cffi_tests/test_c.py +++ b/extra_tests/cffi_tests/test_c.py @@ -1331,7 +1331,9 @@ def test_callback_exception(): except ImportError: import io as cStringIO # Python 3 import linecache - def matches(istr, ipattern): + def matches(istr, ipattern, ipattern38): + if sys.version_info >= (3, 8): + ipattern = ipattern38 str, pattern = istr, ipattern while '$' in pattern: i = pattern.index('$') @@ -1375,6 +1377,14 @@ Traceback (most recent call last): File "$", line $, in check_value $ ValueError: 42 +""", """\ +Exception ignored from cffi callback <function$Zcb1 at 0x$>: +Traceback (most recent call last): + File "$", line $, in Zcb1 + $ + File "$", line $, in check_value + $ +ValueError: 42 """) sys.stderr = cStringIO.StringIO() bigvalue = 20000 @@ -1383,6 +1393,12 @@ ValueError: 42 From cffi callback <function$Zcb1 at 0x$>: Trying to convert the result back to C: OverflowError: integer 60000 does not fit 'short' +""", """\ +Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C: +Traceback (most recent call last): + File "$", line $, in test_callback_exception + $ +OverflowError: integer 60000 does not fit 'short' """) sys.stderr = cStringIO.StringIO() bigvalue = 20000 @@ -1420,6 +1436,17 @@ OverflowError: integer 60000 does not fit 'short' During the call to 'onerror', another exception occurred: TypeError: $integer$ +""", """\ +Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C: +Traceback (most recent call last): + File "$", line $, in test_callback_exception + $ +OverflowError: integer 60000 does not fit 'short' +Exception ignored during handling of the above exception by 'onerror': +Traceback (most recent call last): + File "$", line $, in test_callback_exception + $ +TypeError: $integer$ """) # sys.stderr = cStringIO.StringIO() @@ -1436,6 +1463,17 @@ Traceback (most recent call last): File "$", line $, in oops $ AttributeError: 'str' object has no attribute 'append' +""", """\ +Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C: +Traceback (most recent call last): + File "$", line $, in test_callback_exception + $ +OverflowError: integer 60000 does not fit 'short' +Exception ignored during handling of the above exception by 'onerror': +Traceback (most recent call last): + File "$", line $, in oops + $ +AttributeError: 'str' object has no attribute 'append' """) finally: sys.stderr = orig_stderr |