Skip to content

Commit 3fb0f83

Browse files
committed
Typo and import fixes
1 parent 53856cb commit 3fb0f83

File tree

5 files changed

+7
-14
lines changed

5 files changed

+7
-14
lines changed

cacheback/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Job:
5858
#: refresh the cache.
5959
refresh_timeout = 60
6060

61-
#: Secifies which cache to use from your `CACHES` setting. It defaults to
61+
#: Specifies which cache to use from your `CACHES` setting. It defaults to
6262
#: `default`.
6363
cache_alias = None
6464

@@ -443,7 +443,7 @@ def process_result(self, result, call, cache_status, sync_fetch=None):
443443
:param result: The result to be returned
444444
:param call: A named tuple with properties 'args' and 'kwargs that
445445
holds the call args and kwargs
446-
:param cache_status: A status integrer, accessible as class constants
446+
:param cache_status: A status integer, accessible as class constants
447447
self.MISS, self.HIT, self.STALE
448448
:param sync_fetch: A boolean indicating whether a synchronous fetch was
449449
performed. A value of None indicates that no fetch

cacheback/jobs.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
try:
2-
import importlib
3-
except ImportError:
4-
import django.utils.importlib as importlib
1+
import importlib
52

63
from .base import Job
74

cacheback/utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1+
import importlib
12
import logging
23

34
from django.conf import settings
45
from django.core.exceptions import ImproperlyConfigured
56

67

7-
try:
8-
import importlib
9-
except ImportError:
10-
import django.utils.importlib as importlib
11-
128
try:
139
from .tasks import refresh_cache as celery_refresh_cache
1410
except ImportError:
@@ -58,4 +54,4 @@ def enqueue_task(kwargs, task_options=None):
5854
elif task_queue == 'celery' and celery_refresh_cache is not None:
5955
return celery_refresh_cache.apply_async(kwargs=kwargs, **task_options or {})
6056

61-
raise ImproperlyConfigured(f'Unkown task queue configured: {task_queue}')
57+
raise ImproperlyConfigured(f'Unknown task queue or backend is not configured: {task_queue}')

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def skip_if_no_redis():
1010
try:
1111
redis.StrictRedis(
1212
settings.RQ_QUEUES['default'].get('HOST', 'localhost'),
13-
settings.RQ_QUEUES['default'].get('POST', 6379),
13+
settings.RQ_QUEUES['default'].get('PORT', 6379),
1414
).ping()
1515
skip_if_no_redis._redis_available = True
1616
except redis.ConnectionError:

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ def test_unkown(self, settings):
7272
with pytest.raises(ImproperlyConfigured) as exc:
7373
enqueue_task('foo')
7474

75-
assert 'Unkown task queue' in str(exc.value)
75+
assert 'Unknown task queue' in str(exc.value)

0 commit comments

Comments
 (0)