()
| 179 | |
| 180 | #[test] |
| 181 | fn instance_method() { |
| 182 | let gil = Python::acquire_gil(); |
| 183 | let py = gil.python(); |
| 184 | |
| 185 | let obj = InstanceMethod::create_instance(py, 42).unwrap(); |
| 186 | assert!(obj.method(py).unwrap() == 42); |
| 187 | let d = PyDict::new(py); |
| 188 | d.set_item(py, "obj", obj).unwrap(); |
| 189 | py.run("assert obj.method() == 42", None, Some(&d)).unwrap(); |
| 190 | } |
| 191 | |
| 192 | py_class!(class InstanceMethodReturnsNone |py| { |
| 193 | data member: AtomicUsize; |