[Python-checkins] cpython: Issue #23571: Update test_capi
victor.stinner
python-checkins at python.org
Tue Mar 24 14:07:23 CET 2015
https://hg.python.org/cpython/rev/57550e1f57d9
changeset: 95162:57550e1f57d9
user: Victor Stinner <victor.stinner at gmail.com>
date: Tue Mar 24 14:01:32 2015 +0100
summary:
Issue #23571: Update test_capi
files:
Lib/test/test_capi.py | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -184,7 +184,15 @@
_testcapi.return_null_without_error()
""")
rc, out, err = assert_python_failure('-c', code)
- self.assertIn(b'_Py_CheckFunctionResult', err)
+ self.assertRegex(err.replace(b'\r', b''),
+ br'Fatal Python error: '
+ br'Function result is invalid\n'
+ br'SystemError: <built-in function '
+ br'return_null_without_error> returned NULL '
+ br'without setting an error\n'
+ br'\n'
+ br'Current thread.*:\n'
+ br' File .*", line 6 in <module>')
else:
with self.assertRaises(SystemError) as cm:
_testcapi.return_null_without_error()
@@ -203,7 +211,20 @@
_testcapi.return_result_with_error()
""")
rc, out, err = assert_python_failure('-c', code)
- self.assertIn(b'_Py_CheckFunctionResult', err)
+ self.assertRegex(err.replace(b'\r', b''),
+ br'Fatal Python error: '
+ br'Function result is invalid\n'
+ br'ValueError\n'
+ br'\n'
+ br'During handling of the above exception, '
+ br'another exception occurred:\n'
+ br'\n'
+ br'SystemError: <built-in '
+ br'function return_result_with_error> '
+ br'returned a result with an error set\n'
+ br'\n'
+ br'Current thread.*:\n'
+ br' File .*, line 6 in <module>')
else:
with self.assertRaises(SystemError) as cm:
_testcapi.return_result_with_error()
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list