MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / inline_two_args

Function inline_two_args

tests/test_function.rs:110–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108
109#[test]
110fn inline_two_args() {
111 let gil = Python::acquire_gil();
112 let py = gil.python();
113 let obj = py_fn!(py, f(a: i32, b: i32) -> PyResult<i32> {
114 drop(py); // avoid unused variable warning
115 Ok(a * b)
116 });
117
118 assert!(obj.call(py, NoArgs, None).is_err());
119 assert_eq!(
120 obj.call(py, (6, 7), None)
121 .unwrap()
122 .extract::<i32>(py)
123 .unwrap(),
124 42
125 );
126}
127
128#[test]
129fn opt_args() {

Callers

nothing calls this directly

Calls 1

pythonMethod · 0.80

Tested by

no test coverage detected