test-bundle2-format: force gc so a GeneratorExit will be thrown
authorBryan O'Sullivan <bos@serpentine.com>
Wed, 23 Dec 2015 16:22:20 -0800
changeset 27539 23541bdd1610
parent 27538 50ad3f25fb4c
child 27540 9dcd55a63f0b
test-bundle2-format: force gc so a GeneratorExit will be thrown PyPy has looser semantics than CPython for when a generator's close method will be called. Forcing the gc causes it to be called at the right moment.
tests/test-bundle2-format.t
--- a/tests/test-bundle2-format.t	Wed Dec 23 16:22:20 2015 -0800
+++ b/tests/test-bundle2-format.t	Wed Dec 23 16:22:20 2015 -0800
@@ -13,7 +13,7 @@
   > code. We still need to be able to test it while it grow up.
   > """
   > 
-  > import sys, os
+  > import sys, os, gc
   > from mercurial import cmdutil
   > from mercurial import util
   > from mercurial import bundle2
@@ -158,6 +158,7 @@
   >                 # too zealous. It's important for this test that the break
   >                 # occur while we're in the middle of a part.
   >                 break
+  >         gc.collect()
   >         ui.write('fake timeout complete.\n')
   >         return
   >     try: