Skip to content

Commit

Permalink
try fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
twd2 committed Apr 2, 2017
1 parent 5e1beb9 commit 5836717
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions vj4/test/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from vj4 import db
from vj4.service import bus
from vj4.model import queue
from vj4.service import event
from vj4.service import smallcache
from vj4.util import options
Expand Down Expand Up @@ -42,6 +43,23 @@ def tearDown(self):
super(BusTestCase, self).tearDown()


class QueueTestCase(DatabaseTestCase):
async def noop(*args, **kwargs):
pass

def setUp(self):
super(QueueTestCase, self).setUp()
self.old_publish = queue.publish
queue.publish = QueueTestCase.noop
self.old_consume = queue.consume
queue.consume = QueueTestCase.noop

def tearDown(self):
queue.publish = self.old_publish
queue.consume = self.old_consume
super(QueueTestCase, self).tearDown()


class SmallcacheTestCase(BusTestCase):
def setUp(self):
super(SmallcacheTestCase, self).setUp()
Expand Down
2 changes: 1 addition & 1 deletion vj4/test/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
EPS = 10 ** (-5)


class RecordTestCase(base.DatabaseTestCase):
class RecordTestCase(base.QueueTestCase):
async def init_record(self):
self.pid1 = await problem.add(DOMAIN_ID, 'a+b', 'calc a+b', OWNER_UID)
self.pid2 = await problem.add(DOMAIN_ID, 'a-b', 'calc a-b', OWNER_UID)
Expand Down

0 comments on commit 5836717

Please sign in to comment.