mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-09 10:28:12 +08:00
fixed relative import
This commit is contained in:
@@ -3,12 +3,11 @@ import os
|
|||||||
from multiprocessing import Queue, Event
|
from multiprocessing import Queue, Event
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from conf import REDIS
|
|
||||||
|
|
||||||
myPath = os.path.dirname(os.path.abspath(__file__))
|
myPath = os.path.dirname(os.path.abspath(__file__))
|
||||||
sys.path.insert(0, myPath + '/../')
|
sys.path.insert(0, myPath + '/../')
|
||||||
|
|
||||||
from django_q.core import Cluster, async, pusher, worker, monitor, Sentinel
|
from django_q.core import Cluster, async, pusher, worker, monitor, redis_client, Sentinel
|
||||||
from django_q.humanhash import DEFAULT_WORDLIST
|
from django_q.humanhash import DEFAULT_WORDLIST
|
||||||
from django_q import result, get_task, Task
|
from django_q import result, get_task, Task
|
||||||
from django_q.tests.tasks import multiply
|
from django_q.tests.tasks import multiply
|
||||||
@@ -21,10 +20,11 @@ class WordClass(object):
|
|||||||
def get_words(self):
|
def get_words(self):
|
||||||
return self.word_list
|
return self.word_list
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def r():
|
def r():
|
||||||
import redis
|
return redis_client
|
||||||
return redis.StrictRedis(**REDIS)
|
|
||||||
|
|
||||||
def test_redis_connection(r):
|
def test_redis_connection(r):
|
||||||
assert r.ping() is True
|
assert r.ping() is True
|
||||||
|
|||||||
Reference in New Issue
Block a user