Commit 9af7c7f3 authored by Jason Madden's avatar Jason Madden

Fix test compatibility with persistent 4.6; test CPython with PURE_PYTHON.

parent b5895a5c
language: python language: python
python: python:
- 2.7 - 2.7
- 3.5 - 3.5
...@@ -8,6 +9,13 @@ python: ...@@ -8,6 +9,13 @@ python:
- pypy - pypy
- pypy3 - pypy3
jobs:
include:
# Special Linux builds
- name: "Python: 3.8, pure (no C extensions)"
python: 3.8
env: PURE_PYTHON=1
install: install:
- pip install -U pip - pip install -U pip
- pip install -U setuptools zc.buildout - pip install -U setuptools zc.buildout
......
...@@ -383,6 +383,13 @@ class CacheErrors(unittest.TestCase): ...@@ -383,6 +383,13 @@ class CacheErrors(unittest.TestCase):
# to None actually go *down* by a few. Possibly it has to # to None actually go *down* by a few. Possibly it has to
# do with the lazy tracking of frames? # do with the lazy tracking of frames?
# (https://github.com/python/cpython/commit/5a625d0aa6a6d9ec6574ee8344b41d63dcb9897e) # (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) self.assertLessEqual(rc(None), nones)
def testTwoCaches(self): def testTwoCaches(self):
......
...@@ -127,17 +127,11 @@ then, + 1 for the root object: ...@@ -127,17 +127,11 @@ then, + 1 for the root object:
True True
Making a savepoint at this time used to leave the cache holding the same 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() >>> 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() >>> _ = gc.collect()
>>> _ = getattr(cn._cache, 'data', {}).values()
>>> _ = getattr(cn._cache, 'data', {}).keys()
>>> len(cn._cache) <= CACHESIZE + 1 >>> len(cn._cache) <= CACHESIZE + 1
True True
......
...@@ -7,7 +7,7 @@ import ZODB ...@@ -7,7 +7,7 @@ import ZODB
class ZODBClientThread(threading.Thread): class ZODBClientThread(threading.Thread):
sleep_time = 15 sleep_time = 3
def __init__(self, db, test): def __init__(self, db, test):
threading.Thread.__init__(self) threading.Thread.__init__(self)
......
[tox] [tox]
envlist = py27,py35,py36,py37,py38,pypy,pypy3 envlist = py27,py35,py36,py37,py38,pypy,pypy3,py38-pure
[testenv] [testenv]
# ZODB.tests.testdocumentation needs to find # ZODB.tests.testdocumentation needs to find
...@@ -22,3 +22,9 @@ commands = ...@@ -22,3 +22,9 @@ commands =
deps = deps =
{[testenv]deps} {[testenv]deps}
coverage 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