Author: Brian Kearns <[email protected]>
Branch:
Changeset: r62065:c2c7a22badee
Date: 2013-03-05 03:33 -0500
http://bitbucket.org/pypy/pypy/changeset/c2c7a22badee/
Log: more fixes for this test
diff --git a/pypy/module/test_lib_pypy/test_sqlite3.py
b/pypy/module/test_lib_pypy/test_sqlite3.py
--- a/pypy/module/test_lib_pypy/test_sqlite3.py
+++ b/pypy/module/test_lib_pypy/test_sqlite3.py
@@ -67,6 +67,7 @@
@pytest.mark.skipif("not hasattr(sys, 'pypy_translation_info')")
def test_connection_del(tmpdir):
"""For issue1325."""
+ import os
import gc
try:
import resource
@@ -75,10 +76,19 @@
limit = resource.getrlimit(resource.RLIMIT_NOFILE)
try:
- resource.setrlimit(resource.RLIMIT_NOFILE, (min(10, limit[0]),
limit[1]))
+ fds = 0
+ while True:
+ fds += 1
+ resource.setrlimit(resource.RLIMIT_NOFILE, (fds, limit[1]))
+ try:
+ for p in os.pipe(): os.close(p)
+ except OSError:
+ assert fds < 100
+ else:
+ break
def open_many(cleanup):
con = []
- for i in range(20):
+ for i in range(3):
con.append(_sqlite3.connect(str(tmpdir.join('test.db'))))
if cleanup:
con[i] = None
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit