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

Function new_with_one_arg

tests/test_class.rs:101–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99
100#[test]
101fn new_with_one_arg() {
102 let gil = Python::acquire_gil();
103 let py = gil.python();
104 let typeobj = py.get_type::<NewWithOneArg>();
105 let obj = typeobj
106 .call(py, (42,), None)
107 .unwrap()
108 .cast_into::<NewWithOneArg>(py)
109 .unwrap();
110 assert_eq!(*obj._data(py), 42);
111}
112
113py_class!(class NewWithTwoArgs |py| {
114 data _data1: i32;

Callers

nothing calls this directly

Calls 2

pythonMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected