Commits

Thomas Waldmann  committed 5a209d7

fix fieldcache test failures on pypy (by adding gc.collect() calls), fixes #242

  • Participants
  • Parent commits 321dd76
  • Branches 2.4x

Comments (0)

Files changed (1)

File tests/test_sorting.py

 from __future__ import with_statement
 from datetime import datetime, timedelta
 import random
+import gc
 
 from nose.tools import assert_equal  # @UnresolvedImport
 
     with ix.reader() as r:
         _ = r.fieldcache("id")
         del _
+    gc.collect()
 
     ix = st.open_index()
     with ix.reader() as r:
             r.fieldcache("num")
             assert r.fieldcache_loaded("num")
             r.unload_fieldcache("num")
+            gc.collect()
             assert not r.fieldcache_loaded("num")
             assert r.fieldcache_available("num")
 
             r.fieldcache("num")
             assert r.fieldcache_loaded("num")
             r.unload_fieldcache("num")
+            gc.collect()
             assert not r.fieldcache_loaded("num")
             assert r.fieldcache_available("num")
 
         r1.close()
         r2.close()
         del r1, fc1, r2, fc2
-        import gc
         gc.collect()
 
         assert not r3.fieldcache_loaded("id")