mirror of https://github.com/rq/rq.git
Fix tests to use logging
This commit is contained in:
parent
82c4ac6ec2
commit
a08c983efc
|
@ -1,6 +1,7 @@
|
||||||
|
import logging
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from redis import Redis
|
from redis import Redis
|
||||||
from logbook import NullHandler
|
|
||||||
from rq import push_connection, pop_connection
|
from rq import push_connection, pop_connection
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,9 +48,8 @@ class RQTestCase(unittest.TestCase):
|
||||||
# Store the connection (for sanity checking)
|
# Store the connection (for sanity checking)
|
||||||
cls.testconn = testconn
|
cls.testconn = testconn
|
||||||
|
|
||||||
# Shut up logbook
|
# Shut up logging
|
||||||
cls.log_handler = NullHandler()
|
logging.disable("ERROR")
|
||||||
cls.log_handler.push_thread()
|
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
# Flush beforewards (we like our hygiene)
|
# Flush beforewards (we like our hygiene)
|
||||||
|
@ -66,7 +66,7 @@ class RQTestCase(unittest.TestCase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
cls.log_handler.pop_thread()
|
logging.disable(logging.NOTSET)
|
||||||
|
|
||||||
# Pop the connection to Redis
|
# Pop the connection to Redis
|
||||||
testconn = pop_connection()
|
testconn = pop_connection()
|
||||||
|
|
Loading…
Reference in New Issue