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

Function new_with_two_args

tests/test_class.rs:122–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

120
121#[test]
122fn new_with_two_args() {
123 let gil = Python::acquire_gil();
124 let py = gil.python();
125 let typeobj = py.get_type::<NewWithTwoArgs>();
126 let obj = typeobj
127 .call(py, (10, 20), None)
128 .unwrap()
129 .cast_into::<NewWithTwoArgs>(py)
130 .unwrap();
131 assert_eq!(*obj._data1(py), 10);
132 assert_eq!(*obj._data2(py), 20);
133}
134
135struct TestDropCall {
136 drop_called: Arc<AtomicBool>,

Callers

nothing calls this directly

Calls 2

pythonMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected