()
| 388 | |
| 389 | #[test] |
| 390 | fn gc_integration() { |
| 391 | let gil = Python::acquire_gil(); |
| 392 | let py = gil.python(); |
| 393 | |
| 394 | let drop_called = Arc::new(AtomicBool::new(false)); |
| 395 | let inst = GCIntegration::create_instance( |
| 396 | py, |
| 397 | RefCell::new(py.None()), |
| 398 | TestDropCall { |
| 399 | drop_called: drop_called.clone(), |
| 400 | }, |
| 401 | ) |
| 402 | .unwrap(); |
| 403 | *inst.self_ref(py).borrow_mut() = inst.as_object().clone_ref(py); |
| 404 | inst.release_ref(py); |
| 405 | |
| 406 | py.run("import gc; gc.collect()", None, None).unwrap(); |
| 407 | assert!(drop_called.load(Ordering::Relaxed)); |
| 408 | } |
| 409 | |
| 410 | py_class!(class Len |py| { |
| 411 | data l: usize; |
nothing calls this directly
no test coverage detected