@@ -174,7 +174,7 @@ def test_simple(self):
174174 gc .collect ()
175175 self .assert_del_calls (ids )
176176 self .assert_survivors ([])
177- self .assertIs (wr (), None )
177+ self .assertIsNone (wr ())
178178 gc .collect ()
179179 self .assert_del_calls (ids )
180180 self .assert_survivors ([])
@@ -188,12 +188,12 @@ def test_simple_resurrect(self):
188188 gc .collect ()
189189 self .assert_del_calls (ids )
190190 self .assert_survivors (ids )
191- self .assertIsNot (wr (), None )
191+ self .assertIsNotNone (wr ())
192192 self .clear_survivors ()
193193 gc .collect ()
194194 self .assert_del_calls (ids )
195195 self .assert_survivors ([])
196- self .assertIs (wr (), None )
196+ self .assertIsNone (wr ())
197197
198198 @support .cpython_only
199199 def test_non_gc (self ):
@@ -265,7 +265,7 @@ def test_simple(self):
265265 gc .collect ()
266266 self .assert_del_calls (ids )
267267 self .assert_survivors ([])
268- self .assertIs (wr (), None )
268+ self .assertIsNone (wr ())
269269 gc .collect ()
270270 self .assert_del_calls (ids )
271271 self .assert_survivors ([])
@@ -283,7 +283,7 @@ def test_simple_resurrect(self):
283283 self .assert_survivors (ids )
284284 # This used to be None because weakrefs were cleared before
285285 # calling finalizers. Now they are cleared after.
286- self .assertIsNot (wr (), None )
286+ self .assertIsNotNone (wr ())
287287 # A weakref with a callback is still cleared before calling
288288 # finalizers.
289289 self .assertIsNone (wrc ())
@@ -293,7 +293,7 @@ def test_simple_resurrect(self):
293293 gc .collect ()
294294 self .assert_del_calls (ids )
295295 self .assert_survivors ([])
296- self .assertIs (wr (), None )
296+ self .assertIsNone (wr ())
297297
298298 def test_simple_suicide (self ):
299299 # Test the GC is able to deal with an object that kills its last
@@ -306,11 +306,11 @@ def test_simple_suicide(self):
306306 gc .collect ()
307307 self .assert_del_calls (ids )
308308 self .assert_survivors ([])
309- self .assertIs (wr (), None )
309+ self .assertIsNone (wr ())
310310 gc .collect ()
311311 self .assert_del_calls (ids )
312312 self .assert_survivors ([])
313- self .assertIs (wr (), None )
313+ self .assertIsNone (wr ())
314314
315315
316316class ChainedBase :
@@ -505,7 +505,7 @@ def test_legacy(self):
505505 self .assert_del_calls (ids )
506506 self .assert_tp_del_calls (ids )
507507 self .assert_survivors ([])
508- self .assertIs (wr (), None )
508+ self .assertIsNone (wr ())
509509 gc .collect ()
510510 self .assert_del_calls (ids )
511511 self .assert_tp_del_calls (ids )
@@ -521,13 +521,13 @@ def test_legacy_resurrect(self):
521521 self .assert_tp_del_calls (ids )
522522 self .assert_survivors (ids )
523523 # weakrefs are cleared before tp_del is called.
524- self .assertIs (wr (), None )
524+ self .assertIsNone (wr ())
525525 self .clear_survivors ()
526526 gc .collect ()
527527 self .assert_del_calls (ids )
528528 self .assert_tp_del_calls (ids * 2 )
529529 self .assert_survivors (ids )
530- self .assertIs (wr (), None )
530+ self .assertIsNone (wr ())
531531
532532 def test_legacy_self_cycle (self ):
533533 # Self-cycles with legacy finalizers end up in gc.garbage.
@@ -541,11 +541,11 @@ def test_legacy_self_cycle(self):
541541 self .assert_tp_del_calls ([])
542542 self .assert_survivors ([])
543543 self .assert_garbage (ids )
544- self .assertIsNot (wr (), None )
544+ self .assertIsNotNone (wr ())
545545 # Break the cycle to allow collection
546546 gc .garbage [0 ].ref = None
547547 self .assert_garbage ([])
548- self .assertIs (wr (), None )
548+ self .assertIsNone (wr ())
549549
550550
551551if __name__ == "__main__" :
0 commit comments