Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix the dispatch test GC code under PyPy, and make the comment for Jy…

…thon better.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17322 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1aaa0dd09865980743f940bc16ea1982aee49866 1 parent b9910bd
Alex Gaynor authored January 01, 2012
9  tests/regressiontests/dispatch/tests/test_dispatcher.py
@@ -8,9 +8,16 @@
8 8
 
9 9
 if sys.platform.startswith('java'):
10 10
     def garbage_collect():
11  
-        """Run the garbage collector and wait a bit to let it do his work"""
  11
+        # Some JVM GCs will execute finalizers in a different thread, meaning
  12
+        # we need to wait for that to complete before we go on looking for the
  13
+        # effects of that.
12 14
         gc.collect()
13 15
         time.sleep(0.1)
  16
+elif hasattr(sys, "pypy_version_info"):
  17
+    def garbage_collect():
  18
+        # Collecting weakreferences can take two collections on PyPy.
  19
+        gc.collect()
  20
+        gc.collect()
14 21
 else:
15 22
     def garbage_collect():
16 23
         gc.collect()

0 notes on commit 1aaa0dd

Please sign in to comment.
Something went wrong with that request. Please try again.