Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Commit

Permalink
Use static pool with Pypy on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Oct 27, 2015
1 parent 569780d commit 7785ef1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions cliquet/storage/postgresql/client.py
@@ -1,4 +1,6 @@
import contextlib
import os
import platform
import warnings

from cliquet import logger
Expand Down Expand Up @@ -77,6 +79,14 @@ def create_from_config(config, prefix=''):
settings[poolclass_key] = config.maybe_dotted(settings[poolclass_key])
settings.pop(prefix + 'max_fetch_size', None)

# There seems to be a problem with the pool implementation using PyPy.
# XXX: Disable pooling at least during tests to avoid stalled tests.
pypy_on_travis = (platform.python_implementation().lower() == 'pypy' and
os.getenv('TRAVIS', False))
if pypy_on_travis:
warnings.warn('Disable pooling with PyPy on TravisCI')
settings = dict([(poolclass_key, sqlalchemy.pool.StaticPool)])

engine = sqlalchemy.engine_from_config(settings, prefix=prefix, url=url)

# Store one engine per URI.
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -6,7 +6,7 @@ skip_missing_interpreters = True
passenv = TRAVIS
commands =
python --version
nosetests --with-coverage --cover-min-percentage=100 --cover-package=cliquet cliquet {posargs}
nosetests -s -v cliquet {posargs}
deps =
coverage
mock
Expand Down

0 comments on commit 7785ef1

Please sign in to comment.