mirror of https://github.com/rq/rq.git
Shut up logbook during tests.
This commit is contained in:
parent
4eb8425acc
commit
068db4cb35
|
@ -1,6 +1,7 @@
|
||||||
import unittest
|
import unittest
|
||||||
from pickle import loads
|
from pickle import loads
|
||||||
from redis import Redis
|
from redis import Redis
|
||||||
|
from logbook import NullHandler
|
||||||
from rq import conn, Queue, Worker
|
from rq import conn, Queue, Worker
|
||||||
|
|
||||||
# Test data
|
# Test data
|
||||||
|
@ -24,7 +25,13 @@ class RQTestCase(unittest.TestCase):
|
||||||
# Store the connection (for sanity checking)
|
# Store the connection (for sanity checking)
|
||||||
self.testconn = testconn
|
self.testconn = testconn
|
||||||
|
|
||||||
|
# Shut up logbook
|
||||||
|
self.log_handler = NullHandler()
|
||||||
|
self.log_handler.push_thread()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
self.log_handler.pop_thread()
|
||||||
|
|
||||||
# Flush afterwards
|
# Flush afterwards
|
||||||
conn.flushdb()
|
conn.flushdb()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue