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

Function class_method_with_args

tests/test_class.rs:289–302  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

287
288#[test]
289fn class_method_with_args() {
290 let gil = Python::acquire_gil();
291 let py = gil.python();
292
293 let d = PyDict::new(py);
294 d.set_item(py, "C", py.get_type::<ClassMethodWithArgs>())
295 .unwrap();
296 py.run(
297 "assert C.method('abc') == 'ClassMethodWithArgs.method(abc)'",
298 None,
299 Some(&d),
300 )
301 .unwrap();
302}
303
304py_class!(class StaticMethod |py| {
305 def __new__(cls) -> PyResult<StaticMethod> {

Callers

nothing calls this directly

Calls 3

pythonMethod · 0.80
runMethod · 0.80
set_itemMethod · 0.45

Tested by

no test coverage detected