mirror of
https://github.com/wassname/cachier.git
synced 2026-09-09 11:19:08 +08:00
removed repoze.lru test dependency for python 2.7
This commit is contained in:
@@ -11,8 +11,6 @@ before_install:
|
||||
# coverage submission packages
|
||||
- pip install codecov
|
||||
install:
|
||||
# Coveralls 4.0 doesn't support Python 3.2
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then travis_retry pip install repoze.lru; fi
|
||||
- pip install ".[test]"
|
||||
script: pytest --cov=pcachier
|
||||
# submit coverage
|
||||
|
||||
@@ -6,10 +6,6 @@ from time import sleep
|
||||
|
||||
from cachier import cachier
|
||||
from pymongo.mongo_client import MongoClient
|
||||
try:
|
||||
from functools import lru_cache
|
||||
except ImportError:
|
||||
from repoze.lru import lru_cache
|
||||
|
||||
_TEST_HOST = 'ds119508.mlab.com'
|
||||
_TEST_PORT = 19508
|
||||
@@ -27,9 +23,10 @@ def _get_cachier_db_mongo_client():
|
||||
return client
|
||||
|
||||
|
||||
@lru_cache(2)
|
||||
def _mongo_getter():
|
||||
return _get_cachier_db_mongo_client()['cachier_test']['cachier_test']
|
||||
if not hasattr(_mongo_getter, 'client'):
|
||||
_mongo_getter.client = _get_cachier_db_mongo_client()
|
||||
return _mongo_getter.client['cachier_test']['cachier_test']
|
||||
|
||||
|
||||
# Mongo core tests
|
||||
|
||||
Reference in New Issue
Block a user