@@ -362,7 +362,7 @@ fn decrement_attach_count() {
362362mod tests {
363363 use super :: * ;
364364
365- use crate :: { types :: PyAnyMethods , Py , PyAny , Python } ;
365+ use crate :: { Py , PyAny , Python } ;
366366
367367 fn get_object ( py : Python < ' _ > ) -> Py < PyAny > {
368368 py. eval ( c"object()" , None , None ) . unwrap ( ) . unbind ( )
@@ -396,14 +396,14 @@ mod tests {
396396 // Create a reference to drop while attached.
397397 let reference = obj. clone_ref ( py) ;
398398
399- assert_eq ! ( obj. get_refcnt ( py) , 2 ) ;
399+ assert_eq ! ( obj. _get_refcnt ( py) , 2 ) ;
400400 #[ cfg( not( pyo3_disable_reference_pool) ) ]
401401 assert ! ( pool_dec_refs_does_not_contain( & obj) ) ;
402402
403403 // While attached, reference count will be decreased immediately.
404404 drop ( reference) ;
405405
406- assert_eq ! ( obj. get_refcnt ( py) , 1 ) ;
406+ assert_eq ! ( obj. _get_refcnt ( py) , 1 ) ;
407407 #[ cfg( not( any( pyo3_disable_reference_pool) ) ) ]
408408 assert ! ( pool_dec_refs_does_not_contain( & obj) ) ;
409409 } ) ;
@@ -417,15 +417,15 @@ mod tests {
417417 // Create a reference to drop while detached.
418418 let reference = obj. clone_ref ( py) ;
419419
420- assert_eq ! ( obj. get_refcnt ( py) , 2 ) ;
420+ assert_eq ! ( obj. _get_refcnt ( py) , 2 ) ;
421421 assert ! ( pool_dec_refs_does_not_contain( & obj) ) ;
422422
423423 // Drop reference in a separate (detached) thread.
424424 std:: thread:: spawn ( move || drop ( reference) ) . join ( ) . unwrap ( ) ;
425425
426426 // The reference count should not have changed, it is remembered
427427 // to release later.
428- assert_eq ! ( obj. get_refcnt ( py) , 2 ) ;
428+ assert_eq ! ( obj. _get_refcnt ( py) , 2 ) ;
429429 #[ cfg( not( Py_GIL_DISABLED ) ) ]
430430 assert ! ( pool_dec_refs_contains( & obj) ) ;
431431 obj
@@ -438,7 +438,7 @@ mod tests {
438438 // DECREFs after releasing the lock on the POOL, so the
439439 // refcnt could still be 2 when this assert happens
440440 #[ cfg( not( Py_GIL_DISABLED ) ) ]
441- assert_eq ! ( obj. get_refcnt ( py) , 1 ) ;
441+ assert_eq ! ( obj. _get_refcnt ( py) , 1 ) ;
442442 assert ! ( pool_dec_refs_does_not_contain( & obj) ) ;
443443 } ) ;
444444 }
@@ -501,7 +501,7 @@ mod tests {
501501 Python :: attach ( |py| {
502502 // Make a simple object with 1 reference
503503 let obj = get_object ( py) ;
504- assert_eq ! ( obj. get_refcnt ( py) , 1 ) ;
504+ assert_eq ! ( obj. _get_refcnt ( py) , 1 ) ;
505505 // Cloning the object when detached should panic
506506 py. detach ( || obj. clone ( ) ) ;
507507 } ) ;
@@ -511,7 +511,7 @@ mod tests {
511511 fn recursive_attach_ok ( ) {
512512 Python :: attach ( |py| {
513513 let obj = Python :: attach ( |_| py. eval ( c"object()" , None , None ) . unwrap ( ) ) ;
514- assert_eq ! ( obj. get_refcnt ( ) , 1 ) ;
514+ assert_eq ! ( obj. _get_refcnt ( ) , 1 ) ;
515515 } )
516516 }
517517
@@ -520,12 +520,12 @@ mod tests {
520520 fn test_clone_attached ( ) {
521521 Python :: attach ( |py| {
522522 let obj = get_object ( py) ;
523- let count = obj. get_refcnt ( py) ;
523+ let count = obj. _get_refcnt ( py) ;
524524
525525 // Cloning when attached should increase reference count immediately
526526 #[ expect( clippy:: redundant_clone) ]
527527 let c = obj. clone ( ) ;
528- assert_eq ! ( count + 1 , c. get_refcnt ( py) ) ;
528+ assert_eq ! ( count + 1 , c. _get_refcnt ( py) ) ;
529529 } )
530530 }
531531
0 commit comments