Commit 6601d634 authored by Jason Madden's avatar Jason Madden Committed by GitHub

Merge pull request #296 from zopefoundation/pure-python-tests

Fix test compatibility with persistent 4.6; test CPython with PURE_PYTHON
parents b5895a5c 9af7c7f3
language: python
python:
- 2.7
- 3.5
......@@ -8,6 +9,13 @@ python:
- pypy
- pypy3
jobs:
include:
# Special Linux builds
- name: "Python: 3.8, pure (no C extensions)"
python: 3.8
env: PURE_PYTHON=1
install:
- pip install -U pip
- pip install -U setuptools zc.buildout
......
......@@ -383,6 +383,13 @@ class CacheErrors(unittest.TestCase):
# to None actually go *down* by a few. Possibly it has to
# do with the lazy tracking of frames?
# (https://github.com/python/cpython/commit/5a625d0aa6a6d9ec6574ee8344b41d63dcb9897e)
#
# Likewise, on 3.8 with PURE_PYTHON it sometimes increases
# by 1; this is cleared up by a garbage collection (it's
# not clear where/why)
new_nones = rc(None)
if new_nones > nones:
gc.collect()
self.assertLessEqual(rc(None), nones)
def testTwoCaches(self):
......
......@@ -127,17 +127,11 @@ then, + 1 for the root object:
True
Making a savepoint at this time used to leave the cache holding the same
number of objects. Make sure the cache shrinks now instead.
number of objects. Make sure the cache shrinks now instead. (Implementations that use
weak references, such as PyPy, may need a garbage collection.)
>>> dummy = transaction.savepoint()
Jython needs a GC, and needs to actually access the cache data to be
sure the size is updated (it uses "eventually consistent" implementations for
its weak dictionaries):
>>> _ = gc.collect()
>>> _ = getattr(cn._cache, 'data', {}).values()
>>> _ = getattr(cn._cache, 'data', {}).keys()
>>> len(cn._cache) <= CACHESIZE + 1
True
......
......@@ -7,7 +7,7 @@ import ZODB
class ZODBClientThread(threading.Thread):
sleep_time = 15
sleep_time = 3
def __init__(self, db, test):
threading.Thread.__init__(self)
......
[tox]
envlist = py27,py35,py36,py37,py38,pypy,pypy3
envlist = py27,py35,py36,py37,py38,pypy,pypy3,py38-pure
[testenv]
# ZODB.tests.testdocumentation needs to find
......@@ -22,3 +22,9 @@ commands =
deps =
{[testenv]deps}
coverage
[testenv:py38-pure]
basepython =
python3.8
setenv =
PURE_PYTHON = 1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment