Skip to content

Commit

Permalink
Fix test compatibility with persistent 4.6; test CPython with PURE_PY…
Browse files Browse the repository at this point in the history
…THON.
  • Loading branch information
jamadden committed Mar 5, 2020
1 parent b5895a5 commit 3e596f3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
@@ -1,4 +1,5 @@
language: python

python:
- 2.7
- 3.5
Expand All @@ -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
Expand Down
10 changes: 2 additions & 8 deletions src/ZODB/tests/testConnectionSavepoint.py
Expand Up @@ -127,17 +127,11 @@ def testSavepointDoesCacheGC():
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
Expand Down
8 changes: 7 additions & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[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
Expand All @@ -22,3 +22,9 @@ commands =
deps =
{[testenv]deps}
coverage

[testenv:py38-pure]
basepython =
python3.8
setenv =
PURE_PYTHON = 1

0 comments on commit 3e596f3

Please sign in to comment.