aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2022-11-21 07:28:20 +0200
committerMatti Picus <matti.picus@gmail.com>2022-11-21 07:28:20 +0200
commitba7df47c38dc4728e560b1b3f1c2575b85a493e9 (patch)
tree431a7b97d0656b33c86448bb218793d6c6b89f01
parentfix expected error (diff)
downloadpypy-ba7df47c38dc4728e560b1b3f1c2575b85a493e9.tar.gz
pypy-ba7df47c38dc4728e560b1b3f1c2575b85a493e9.tar.bz2
pypy-ba7df47c38dc4728e560b1b3f1c2575b85a493e9.zip
host python2 (pypy vs cpython) emits different message for 1/0
-rw-r--r--pypy/module/cpyext/test/test_cpyext.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pypy/module/cpyext/test/test_cpyext.py b/pypy/module/cpyext/test/test_cpyext.py
index 291f7602cd..483f102bb5 100644
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -769,12 +769,13 @@ class AppTestCpythonExtension(AppTestCpythonExtensionBase):
module = self.import_module(name='foo', init=init, body=body)
# uncaught interplevel exceptions are turned into SystemError
- expected = "ZeroDivisionError('integer division by zero',)"
+ expected = "ZeroDivisionError('integer division"
exc = raises(SystemError, module.crash1)
- assert exc.value[0] == expected
+ # Work around difference in err msg btween CPython2 and PyPy2
+ assert exc.value[0].startswith(expected)
exc = raises(SystemError, module.crash2)
- assert exc.value[0] == expected
+ assert exc.value[0].startswith(expected)
# caught exception, api.cpython_api return value works
assert module.crash3() == -1