@@ -391,11 +391,10 @@ def test_update_array_steal(self):
391391 self .check_update_method ('update_array_steal' )
392392
393393 def test_finish (self ):
394- # Test PyFrozenSetWriter_Finish(): track the frozenset in the GC if at
395- # least one item is tracked by the GC
394+ # Test PyFrozenSetWriter_Finish(): track the frozenset in the GC
396395 writer = self .create_writer ()
397396 writer .update ([2 , 5 , 7 ])
398- self .assertFalse (gc .is_tracked (writer .finish ()))
397+ self .assertTrue (gc .is_tracked (writer .finish ()))
399398
400399 class MyObject :
401400 pass
@@ -418,19 +417,22 @@ def test_discard(self):
418417
419418 @threading_helper .requires_working_threading ()
420419 def test_thread (self ):
421- # PyFrozenSetWriter can be used by multiple threads: it's up to the caller
422- # to implement a lock to prevent concurrent accesses.
420+ # PyFrozenSetWriter can be used by multiple threads: it's up to the
421+ # caller to implement a lock to prevent concurrent accesses.
423422 writer = self .create_writer ()
424423
425424 def thread_func (writer ):
426- writer .add ('Hello' )
427- writer .update (['World!' ])
425+ writer .add ('a' )
426+ writer .add_steal ('b' )
427+ writer .update (['c' ])
428+ writer .update_array (['d' ])
429+ writer .update_array_steal (['e' ])
428430
429431 thread = threading .Thread (target = thread_func , args = (writer ,))
430432 thread .start ()
431433 threading_helper .join_thread (thread )
432434
433- self .frozenset_equal (writer .finish (), { 'Hello' , 'World!' } )
435+ self .frozenset_equal (writer .finish (), frozenset ( 'abcde' ) )
434436
435437
436438if __name__ == "__main__" :
0 commit comments