[pypy-commit] pypy py3.6: tweak tests for PyPy
mattip
pypy.commits at gmail.com
Mon Aug 26 17:27:47 EDT 2019
Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.6
Changeset: r97287:251eb63edc0f
Date: 2019-08-27 00:27 +0300
http://bitbucket.org/pypy/pypy/changeset/251eb63edc0f/
Log: tweak tests for PyPy
diff --git a/lib-python/3/unittest/test/test_case.py b/lib-python/3/unittest/test/test_case.py
--- a/lib-python/3/unittest/test/test_case.py
+++ b/lib-python/3/unittest/test/test_case.py
@@ -1287,6 +1287,8 @@
with self.assertRaises(TypeError):
self.assertRaises((ValueError, object))
+ @unittest.skipUnless(hasattr(sys, 'getrefcount'),
+ 'test needs sys.getrefcount()')
def testAssertRaisesRefcount(self):
# bpo-23890: assertRaises() must not keep objects alive longer
# than expected
diff --git a/lib-python/3/unittest/test/testmock/testmock.py b/lib-python/3/unittest/test/testmock/testmock.py
--- a/lib-python/3/unittest/test/testmock/testmock.py
+++ b/lib-python/3/unittest/test/testmock/testmock.py
@@ -784,7 +784,8 @@
self.addCleanup(sys.setrecursionlimit, current)
# can't use sys.maxint as this doesn't exist in Python 3
- sys.setrecursionlimit(int(10e8))
+ # changed from 10e8 to 10e6 on PyPY, 10e8 causes a MemoryError
+ sys.setrecursionlimit(int(10e6))
# this segfaults without the fix in place
copy.copy(Mock())
More information about the pypy-commit
mailing list