Always use FakeMemcache for in-process tests

Better isolation and consistency for in-process functests to always use
the FakeMemcache.  If you want to test the real memcache you have real
functional tests.

Change-Id: Ic483f794e122130bd7694c9a5f9a2b1cd0b9a653
This commit is contained in:
Clay Gerrard 2014-11-17 12:30:15 -08:00 committed by Alistair Coles
parent c9f8246378
commit e0307f950b

View File

@ -31,7 +31,6 @@ from contextlib import closing
from gzip import GzipFile from gzip import GzipFile
from shutil import rmtree from shutil import rmtree
from tempfile import mkdtemp from tempfile import mkdtemp
from swift.common.memcached import MemcacheConnectionError
from swift.common.middleware.memcache import MemcacheMiddleware from swift.common.middleware.memcache import MemcacheMiddleware
from test import get_config from test import get_config
@ -111,11 +110,7 @@ class FakeMemcacheMiddleware(MemcacheMiddleware):
def __init__(self, app, conf): def __init__(self, app, conf):
super(FakeMemcacheMiddleware, self).__init__(app, conf) super(FakeMemcacheMiddleware, self).__init__(app, conf)
try: self.memcache = FakeMemcache()
self.memcache.incr('test_for_memcached_running')
except MemcacheConnectionError as e:
print >>sys.stderr, 'Using FakeMemcache: %s' % e.message
self.memcache = FakeMemcache()
# swift.conf contents for in-process functional test runs # swift.conf contents for in-process functional test runs