Skip to content

Commit fecacea

Browse files
committed
Add tests for PyErr_FromFormat with primitives
1 parent c8ec22d commit fecacea

File tree

1 file changed

+14
-0
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests/cpyext

1 file changed

+14
-0
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_err.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,20 @@ def compile_module(self, name):
198198
cmpfunc=unhandled_error_compare
199199
)
200200

201+
test_PyErr_Format_dS = CPyExtFunctionVoid(
202+
_reference_format,
203+
lambda: (
204+
(ValueError, "hello %d times %S", 10, "world"),
205+
(ValueError, "hello %c times %R", 95, "world"),
206+
),
207+
resultspec="O",
208+
argspec='OsiO',
209+
arguments=["PyObject* v", "char* msg", "int arg0", "PyObject* arg1"],
210+
resultval="NULL",
211+
callfunction="PyErr_Format",
212+
cmpfunc=unhandled_error_compare
213+
)
214+
201215
test_PyErr_PrintEx = CPyExtFunction(
202216
lambda args: None,
203217
lambda: (

0 commit comments

Comments
 (0)