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

Function trailing_comma

tests/test_function.rs:84–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82
83#[test]
84fn trailing_comma() {
85 fn f(_py: Python, i: usize, j: usize) -> PyResult<usize> {
86 Ok(i + j)
87 }
88
89 let gil = Python::acquire_gil();
90 let py = gil.python();
91 // Define a function where the parameters are on separate
92 // lines with trailing commas.
93 let obj = py_fn!(
94 py,
95 f(
96 first_parameter_with_long_name: usize,
97 second_parameter_with_long_name: usize,
98 )
99 );
100 assert_eq!(
101 obj.call(py, (1, 1), None)
102 .unwrap()
103 .extract::<i32>(py)
104 .unwrap(),
105 2
106 );
107}
108
109#[test]
110fn inline_two_args() {

Callers

nothing calls this directly

Calls 1

pythonMethod · 0.80

Tested by

no test coverage detected