diff --git a/.travis.yml b/.travis.yml index 7144b7c..bd69c1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/tests/test_mongo_core.py b/tests/test_mongo_core.py index f4aeaca..26688e6 100644 --- a/tests/test_mongo_core.py +++ b/tests/test_mongo_core.py @@ -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