Skip to content

Commit

Permalink
Move benchmark settings to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
grantjenks committed Mar 20, 2019
1 parent 8d33162 commit 2034538
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 34 deletions.
2 changes: 1 addition & 1 deletion tests/benchmark_djangocache.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


def setup():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings_benchmark')
import django
django.setup()

Expand Down
31 changes: 0 additions & 31 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,35 +131,4 @@
'BACKEND': 'diskcache.DjangoCache',
'LOCATION': CACHE_DIR,
},
'memcached': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
},
'redis': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379/1',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
}
},
'filebased': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': '/tmp/django_cache',
'OPTIONS': {
'CULL_FREQUENCY': 10,
'MAX_ENTRIES': 1000,
}
},
'locmem': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'diskcache',
'OPTIONS': {
'CULL_FREQUENCY': 10,
'MAX_ENTRIES': 1000,
}
},
'diskcache': {
'BACKEND': 'diskcache.DjangoCache',
'LOCATION': 'tmp',
},
}
39 changes: 39 additions & 0 deletions tests/settings_benchmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from .settings import *

CACHES = {
'default': {
'BACKEND': 'diskcache.DjangoCache',
'LOCATION': CACHE_DIR,
},
'memcached': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
},
'redis': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379/1',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
}
},
'filebased': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': '/tmp/django_cache',
'OPTIONS': {
'CULL_FREQUENCY': 10,
'MAX_ENTRIES': 1000,
}
},
'locmem': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'diskcache',
'OPTIONS': {
'CULL_FREQUENCY': 10,
'MAX_ENTRIES': 1000,
}
},
'diskcache': {
'BACKEND': 'diskcache.DjangoCache',
'LOCATION': 'tmp',
},
}
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ skip_missing_interpreters=True
[testenv]
deps=
django==1.11.*
django_redis
mock
pylibmc
pytest
pytest-django
commands=python -m pytest
Expand Down

0 comments on commit 2034538

Please sign in to comment.