fix some test_weakref tests to not rely on ref-counting (closes #22267)
1 file changed