Scrapy, a fast high-level web crawling & scraping framework for Python.
Fix test_weakkeycache on PyPy: run gc.collect()
Konstantin Lopuhin5abb70c8d713
diff --git a/tests/test_utils_python.py b/tests/test_utils_python.pyindex 9a0cc975d..e22bd8eb6 100644--- a/tests/test_utils_python.py+++ b/tests/test_utils_python.py@@ -1,3 +1,4 @@+import gcimport functoolsimport operatorimport unittest@@ -144,6 +145,9 @@ class UtilsPythonTestCase(unittest.TestCase):self.assertNotEqual(v, wk[_Weakme()])self.assertEqual(v, wk[k])del k+ for _ in range(100):+ if wk._weakdict:+ gc.collect()self.assertFalse(len(wk._weakdict))@unittest.skipUnless(six.PY2, "deprecated function")