tests: just call log_to_file() from testlib
Now we can run test.sh with MITOGEN_LOG_LEVEL=debug and things just work.
This commit is contained in:
parent
761cd9eaf8
commit
03fcf057dd
|
@ -15,13 +15,6 @@ import mitogen.utils
|
||||||
import testlib
|
import testlib
|
||||||
|
|
||||||
|
|
||||||
import logging
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
mitogen.core._v = True
|
|
||||||
mitogen.core._vv = True
|
|
||||||
mitogen.core.IOLOG.setLevel(logging.DEBUG)
|
|
||||||
|
|
||||||
|
|
||||||
class ImporterMixin(testlib.RouterMixin):
|
class ImporterMixin(testlib.RouterMixin):
|
||||||
modname = None
|
modname = None
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@ import urlparse
|
||||||
import unittest2
|
import unittest2
|
||||||
|
|
||||||
import mitogen.master
|
import mitogen.master
|
||||||
|
import mitogen.utils
|
||||||
|
|
||||||
if mitogen.is_master: # TODO: shouldn't be necessary.
|
if mitogen.is_master: # TODO: shouldn't be necessary.
|
||||||
import docker
|
import docker
|
||||||
|
|
||||||
|
@ -17,10 +19,7 @@ if mitogen.is_master: # TODO: shouldn't be necessary.
|
||||||
DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
|
DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
|
||||||
sys.path.append(DATA_DIR)
|
sys.path.append(DATA_DIR)
|
||||||
|
|
||||||
|
mitogen.utils.log_to_file()
|
||||||
def set_debug():
|
|
||||||
import logging
|
|
||||||
logging.getLogger('mitogen').setLevel(logging.DEBUG)
|
|
||||||
|
|
||||||
|
|
||||||
def data_path(suffix):
|
def data_path(suffix):
|
||||||
|
|
|
@ -4,6 +4,7 @@ import tempfile
|
||||||
import time
|
import time
|
||||||
import unittest2
|
import unittest2
|
||||||
|
|
||||||
|
import testlib
|
||||||
import mitogen.parent
|
import mitogen.parent
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,8 +12,6 @@ class TtyCreateChildTest(unittest2.TestCase):
|
||||||
func = staticmethod(mitogen.parent.tty_create_child)
|
func = staticmethod(mitogen.parent.tty_create_child)
|
||||||
|
|
||||||
def test_dev_tty_open_succeeds(self):
|
def test_dev_tty_open_succeeds(self):
|
||||||
import logging
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
tf = tempfile.NamedTemporaryFile()
|
tf = tempfile.NamedTemporaryFile()
|
||||||
try:
|
try:
|
||||||
pid, fd = self.func(
|
pid, fd = self.func(
|
||||||
|
|
Loading…
Reference in New Issue